forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I can't init at 1.1.2 because there's an issue while vendoring the packages. v1.1.2 seem to require two different version of the same package, causing an issue similar to NixOS#30742.
- Loading branch information
Showing
3 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
pkgs/tools/networking/edgedb/0001-dynamically-patchelf-binaries.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
diff --git a/src/portable/install.rs b/src/portable/install.rs | ||
index dc0d932..5394fc1 100644 | ||
--- a/src/portable/install.rs | ||
+++ b/src/portable/install.rs | ||
@@ -133,8 +133,16 @@ fn unpack_package(cache_file: &Path, target_dir: &Path) | ||
for entry in arch.entries()? { | ||
let mut entry = entry?; | ||
let path = entry.path()?; | ||
+ let is_inside_bin = { | ||
+ let mut path_iter = path.iter(); | ||
+ path_iter.next(); // discards first folder | ||
+ path_iter.as_path().starts_with("bin") | ||
+ }; | ||
if let Some(path) = build_path(&target_dir, &*path)? { | ||
- entry.unpack(path)?; | ||
+ entry.unpack(&path)?; | ||
+ if is_inside_bin { | ||
+ nix_patchelf_if_needed(&path); | ||
+ } | ||
} | ||
} | ||
bar.finish_and_clear(); | ||
@@ -203,3 +211,11 @@ pub fn package(pkg_info: &PackageInfo) -> anyhow::Result<InstallInfo> { | ||
|
||
Ok(info) | ||
} | ||
+ | ||
+fn nix_patchelf_if_needed(dest_path: &Path) { | ||
+ let _ = ::std::process::Command::new("@patchelf@/bin/patchelf") | ||
+ .arg("--set-interpreter") | ||
+ .arg("@dynamicLinker@") | ||
+ .arg(dest_path) | ||
+ .output(); | ||
+} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ stdenv | ||
, lib | ||
, runCommand | ||
, patchelf | ||
, fetchFromGitHub | ||
, rustPlatform | ||
, makeWrapper | ||
, pkg-config | ||
, curl | ||
, Security | ||
, CoreServices | ||
, libiconv | ||
, xz | ||
, perl | ||
, substituteAll | ||
}: | ||
|
||
rustPlatform.buildRustPackage rec { | ||
pname = "edgedb"; | ||
version = "unstable-2022-06-27"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "edgedb"; | ||
repo = "edgedb-cli"; | ||
rev = "3c65c8bf0a09988356ad477d0ae234182f809b0a"; | ||
sha256 = "sha256-UqoRa5ZbPJEHo9wyyygrN1ssorgY3cLw/mMrCDXr4gw="; | ||
}; | ||
|
||
cargoSha256 = "sha256-6HJkkem44+dat5bmVEM+7GSJFjCz1dYZeRIPEoEwNlI="; | ||
|
||
nativeBuildInputs = [ makeWrapper pkg-config perl ]; | ||
|
||
buildInputs = [ | ||
curl | ||
] ++ lib.optionals stdenv.isDarwin [ CoreServices Security libiconv xz ]; | ||
|
||
checkFeatures = [ ]; | ||
|
||
patches = [ | ||
(substituteAll { | ||
src = ./0001-dynamically-patchelf-binaries.patch; | ||
inherit patchelf; | ||
dynamicLinker = stdenv.cc.bintools.dynamicLinker; | ||
}) | ||
]; | ||
|
||
doCheck = false; | ||
|
||
meta = with lib; { | ||
description = "EdgeDB cli"; | ||
homepage = "https://www.edgedb.com/docs/cli/index"; | ||
license = with licenses; [ asl20 /* or */ mit ]; | ||
maintainers = [ maintainers.ranfdev ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters