edgedb: init at unstable-2022-06-27

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
https://github.com/NixOS/nixpkgs/issues/30742.

ranfdev cf19e964 18b14a25

+93
+34
pkgs/tools/networking/edgedb/0001-dynamically-patchelf-binaries.patch
··· 1 + diff --git a/src/portable/install.rs b/src/portable/install.rs 2 + index dc0d932..5394fc1 100644 3 + --- a/src/portable/install.rs 4 + +++ b/src/portable/install.rs 5 + @@ -133,8 +133,16 @@ fn unpack_package(cache_file: &Path, target_dir: &Path) 6 + for entry in arch.entries()? { 7 + let mut entry = entry?; 8 + let path = entry.path()?; 9 + + let is_inside_bin = { 10 + + let mut path_iter = path.iter(); 11 + + path_iter.next(); // discards first folder 12 + + path_iter.as_path().starts_with("bin") 13 + + }; 14 + if let Some(path) = build_path(&target_dir, &*path)? { 15 + - entry.unpack(path)?; 16 + + entry.unpack(&path)?; 17 + + if is_inside_bin { 18 + + nix_patchelf_if_needed(&path); 19 + + } 20 + } 21 + } 22 + bar.finish_and_clear(); 23 + @@ -203,3 +211,11 @@ pub fn package(pkg_info: &PackageInfo) -> anyhow::Result<InstallInfo> { 24 + 25 + Ok(info) 26 + } 27 + + 28 + +fn nix_patchelf_if_needed(dest_path: &Path) { 29 + + let _ = ::std::process::Command::new("@patchelf@/bin/patchelf") 30 + + .arg("--set-interpreter") 31 + + .arg("@dynamicLinker@") 32 + + .arg(dest_path) 33 + + .output(); 34 + +}
+55
pkgs/tools/networking/edgedb/default.nix
··· 1 + { stdenv 2 + , lib 3 + , runCommand 4 + , patchelf 5 + , fetchFromGitHub 6 + , rustPlatform 7 + , makeWrapper 8 + , pkg-config 9 + , curl 10 + , Security 11 + , CoreServices 12 + , libiconv 13 + , xz 14 + , perl 15 + , substituteAll 16 + }: 17 + 18 + rustPlatform.buildRustPackage rec { 19 + pname = "edgedb"; 20 + version = "unstable-2022-06-27"; 21 + 22 + src = fetchFromGitHub { 23 + owner = "edgedb"; 24 + repo = "edgedb-cli"; 25 + rev = "3c65c8bf0a09988356ad477d0ae234182f809b0a"; 26 + sha256 = "sha256-UqoRa5ZbPJEHo9wyyygrN1ssorgY3cLw/mMrCDXr4gw="; 27 + }; 28 + 29 + cargoSha256 = "sha256-6HJkkem44+dat5bmVEM+7GSJFjCz1dYZeRIPEoEwNlI="; 30 + 31 + nativeBuildInputs = [ makeWrapper pkg-config perl ]; 32 + 33 + buildInputs = [ 34 + curl 35 + ] ++ lib.optionals stdenv.isDarwin [ CoreServices Security libiconv xz ]; 36 + 37 + checkFeatures = [ ]; 38 + 39 + patches = [ 40 + (substituteAll { 41 + src = ./0001-dynamically-patchelf-binaries.patch; 42 + inherit patchelf; 43 + dynamicLinker = stdenv.cc.bintools.dynamicLinker; 44 + }) 45 + ]; 46 + 47 + doCheck = false; 48 + 49 + meta = with lib; { 50 + description = "EdgeDB cli"; 51 + homepage = "https://www.edgedb.com/docs/cli/index"; 52 + license = with licenses; [ asl20 /* or */ mit ]; 53 + maintainers = [ maintainers.ranfdev ]; 54 + }; 55 + }
+4
pkgs/top-level/all-packages.nix
··· 406 406 407 407 eclipse-mat = callPackage ../development/tools/eclipse-mat { }; 408 408 409 + edgedb = callPackage ../tools/networking/edgedb { 410 + inherit (darwin.apple_sdk.frameworks) CoreServices Security; 411 + }; 412 + 409 413 efficient-compression-tool = callPackage ../tools/compression/efficient-compression-tool { }; 410 414 411 415 evans = callPackage ../development/tools/evans { };