ostree: enable ed25519 support

This was omitted in the latest update.

Only adds ~400 KB.

It required adding openssl to tests so I tacked on some cleanups.
In particular, the GI_TYPELIB_PATH was already being set in the wrapper
so we can remove it from the module (not sure why Gtk was even there).

Also switched away from using pkgconfig and docbook_xsl aliases
and reordered the expression a bit.

+42 -19
-11
nixos/tests/installed-tests/ostree.nix
··· 3 3 makeInstalledTest { 4 4 tested = pkgs.ostree; 5 5 6 - # TODO: Wrap/patch the tests directly in the package 7 6 testConfig = { 8 7 environment.systemPackages = with pkgs; [ 9 - (python3.withPackages (p: with p; [ pyyaml ])) 10 8 gnupg 11 9 ostree 12 10 ]; 13 - 14 - # for GJS tests 15 - environment.variables.GI_TYPELIB_PATH = lib.makeSearchPath "lib/girepository-1.0" (with pkgs; [ 16 - gtk3 17 - pango.out 18 - ostree 19 - gdk-pixbuf 20 - atk 21 - ]); 22 11 }; 23 12 }
+13 -8
pkgs/tools/misc/ostree/default.nix
··· 2 2 , fetchurl 3 3 , fetchpatch 4 4 , substituteAll 5 - , pkgconfig 5 + , pkg-config 6 6 , gtk-doc 7 7 , gobject-introspection 8 8 , gjs ··· 21 21 , fuse 22 22 , utillinuxMinimal 23 23 , libselinux 24 + , libsodium 24 25 , libarchive 25 26 , libcap 26 27 , bzip2 27 28 , yacc 28 29 , libxslt 29 - , docbook_xsl 30 + , docbook-xsl-nons 30 31 , docbook_xml_dtd_42 32 + , openssl 31 33 , python3 32 34 }: 33 35 ··· 59 61 (substituteAll { 60 62 src = ./fix-test-paths.patch; 61 63 python3 = testPython.interpreter; 64 + openssl = "${openssl}/bin/openssl"; 62 65 }) 63 66 ]; 64 67 ··· 66 69 autoconf 67 70 automake 68 71 libtool 69 - pkgconfig 72 + pkg-config 70 73 gtk-doc 71 74 gobject-introspection 72 75 which 73 76 makeWrapper 74 77 yacc 75 78 libxslt 76 - docbook_xsl 79 + docbook-xsl-nons 77 80 docbook_xml_dtd_42 78 81 ]; 79 82 ··· 85 88 gpgme 86 89 fuse 87 90 libselinux 91 + libsodium 88 92 libcap 89 93 libarchive 90 94 bzip2 ··· 95 99 testPython 96 100 gjs 97 101 ]; 98 - 99 - preConfigure = '' 100 - env NOCONFIGURE=1 ./autogen.sh 101 - ''; 102 102 103 103 enableParallelBuilding = true; 104 104 ··· 106 106 "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" 107 107 "--with-systemdsystemgeneratordir=${placeholder "out"}/lib/systemd/system-generators" 108 108 "--enable-installed-tests" 109 + "--with-ed25519-libsodium" 109 110 ]; 110 111 111 112 makeFlags = [ 112 113 "installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/libostree" 113 114 "installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/libostree" 114 115 ]; 116 + 117 + preConfigure = '' 118 + env NOCONFIGURE=1 ./autogen.sh 119 + ''; 115 120 116 121 postFixup = let 117 122 typelibPath = stdenv.lib.makeSearchPath "/lib/girepository-1.0" [
+29
pkgs/tools/misc/ostree/fix-test-paths.patch
··· 1 + diff --git a/tests/libtest.sh b/tests/libtest.sh 2 + index ca457fa2..c0a529ff 100755 3 + --- a/tests/libtest.sh 4 + +++ b/tests/libtest.sh 5 + @@ -709,12 +709,12 @@ gen_ed25519_keys () 6 + { 7 + # Generate private key in PEM format 8 + pemfile="$(mktemp -p ${test_tmpdir} ed25519_XXXXXX.pem)" 9 + - openssl genpkey -algorithm ed25519 -outform PEM -out "${pemfile}" 10 + + @openssl@ genpkey -algorithm ed25519 -outform PEM -out "${pemfile}" 11 + 12 + # Based on: http://openssl.6102.n7.nabble.com/ed25519-key-generation-td73907.html 13 + # Extract the private and public parts from generated key. 14 + - ED25519PUBLIC="$(openssl pkey -outform DER -pubout -in ${pemfile} | tail -c 32 | base64)" 15 + - ED25519SEED="$(openssl pkey -outform DER -in ${pemfile} | tail -c 32 | base64)" 16 + + ED25519PUBLIC="$(@openssl@ pkey -outform DER -pubout -in ${pemfile} | tail -c 32 | base64)" 17 + + ED25519SEED="$(@openssl@ pkey -outform DER -in ${pemfile} | tail -c 32 | base64)" 18 + # Secret key is concantination of SEED and PUBLIC 19 + ED25519SECRET="$(echo ${ED25519SEED}${ED25519PUBLIC} | base64 -d | base64 -w 0)" 20 + 21 + @@ -725,7 +725,7 @@ gen_ed25519_keys () 22 + 23 + gen_ed25519_random_public() 24 + { 25 + - openssl genpkey -algorithm ED25519 | openssl pkey -outform DER | tail -c 32 | base64 26 + + @openssl@ genpkey -algorithm ED25519 | @openssl@ pkey -outform DER | tail -c 32 | base64 27 + } 28 + 29 + is_bare_user_only_repo () { 1 30 diff --git a/tests/test-basic-user-only.sh b/tests/test-basic-user-only.sh 2 31 index f65094fd..105be893 100755 3 32 --- a/tests/test-basic-user-only.sh