Add manifest to each package
This commit is contained in:
parent
4e85cc4dd2
commit
e0c8dfed3e
19
flake.lock
19
flake.lock
|
@ -1,5 +1,24 @@
|
||||||
{
|
{
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"dhall-haskell": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"inputs": {},
|
||||||
|
"narHash": "sha256-wJg4DA700SoQbEz61448sR6BgxRa1R92K3vvCV1g+HY=",
|
||||||
|
"originalUrl": "git+https://github.com/nixos/nixpkgs.git?ref=18.09-beta&rev=1d4de0d552ae9aa66a5b8dee5fb0650a4372d148",
|
||||||
|
"url": "git+https://github.com/nixos/nixpkgs.git?ref=18.09-beta&rev=1d4de0d552ae9aa66a5b8dee5fb0650a4372d148"
|
||||||
|
},
|
||||||
|
"nixpkgsStaticLinux": {
|
||||||
|
"inputs": {},
|
||||||
|
"narHash": "sha256-famU3pJZ4vkElV9qc71HmyRVSvcrAhfMZ0UJKpmmKP8=",
|
||||||
|
"originalUrl": "git+https://github.com/nh2/nixpkgs.git?ref=static-haskell-nix-stack-dhall-working",
|
||||||
|
"url": "git+https://github.com/nh2/nixpkgs.git?ref=static-haskell-nix-stack-dhall-working&rev=925aac04f4ca58aceb83beef18cb7dae0715421b"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"narHash": "sha256-KJl9ZLcMcEsLSPcwcWoc0Ac74/6HKC9LkVMeLwhyhlg=",
|
||||||
|
"originalUrl": "git+https://github.com/dhall-lang/dhall-haskell?ref=flake",
|
||||||
|
"url": "git+https://github.com/dhall-lang/dhall-haskell?ref=flake&rev=aea28adf3d10ff1982aa4ddd176d1476251b932f"
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"inputs": {},
|
"inputs": {},
|
||||||
"narHash": "sha256-NB+H7zK3BB//zM127FqgbG4iAfY+nS/IOyO+uGWA5Ho=",
|
"narHash": "sha256-NB+H7zK3BB//zM127FqgbG4iAfY+nS/IOyO+uGWA5Ho=",
|
||||||
|
|
36
flake.nix
36
flake.nix
|
@ -3,21 +3,29 @@
|
||||||
|
|
||||||
edition = 201909;
|
edition = 201909;
|
||||||
|
|
||||||
outputs = { self, nixpkgs }:
|
inputs.dhall-haskell.uri =
|
||||||
|
"git+https://github.com/dhall-lang/dhall-haskell?ref=flake";
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, dhall-haskell }:
|
||||||
let
|
let
|
||||||
|
localSystem = "x86_64-linux";
|
||||||
|
localPackages = nixpkgs.legacyPackages.${localSystem};
|
||||||
|
|
||||||
unpack = baseUrl:
|
unpack = baseUrl:
|
||||||
{ name, value }: {
|
{ name, value }: {
|
||||||
inherit name;
|
inherit name;
|
||||||
value = nixpkgs.legacyPackages.x86_64-linux.stdenvNoCC.mkDerivation {
|
value = localPackages.stdenvNoCC.mkDerivation {
|
||||||
pname = name;
|
pname = name;
|
||||||
inherit (value) version;
|
inherit (value) version;
|
||||||
|
outputs = [ "out" "manifest" ];
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
src = nixpkgs.legacyPackages.x86_64-linux.fetchurl {
|
src = localPackages.fetchurl {
|
||||||
url = "${baseUrl}${name}/${value.version}.tar.xz";
|
url = "${baseUrl}${name}/${value.version}.tar.xz";
|
||||||
inherit (value) sha256;
|
inherit (value) sha256;
|
||||||
};
|
};
|
||||||
dontConfigure = true;
|
dontConfigure = true;
|
||||||
dontBuild = true;
|
dontBuild = true;
|
||||||
|
buildInputs = [ dhall-haskell.packages.${localSystem}.dhall ];
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
find . -type f | while read FILE; do
|
find . -type f | while read FILE; do
|
||||||
case $FILE in
|
case $FILE in
|
||||||
|
@ -27,6 +35,28 @@
|
||||||
*) install -Dm555 -t $out/bin $FILE;;
|
*) install -Dm555 -t $out/bin $FILE;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
local drv=$out
|
||||||
|
echo '{' >> manifest.tmp
|
||||||
|
if [ -d $drv/bin ]; then
|
||||||
|
echo ', bin = {' >> manifest.tmp
|
||||||
|
find $drv/bin/ -type f -printf ', %f = { mapKey = "%f", mapValue = "%p" }\n' >> manifest.tmp
|
||||||
|
echo '}' >> manifest.tmp
|
||||||
|
fi
|
||||||
|
if [ -d $drv/lib ]; then
|
||||||
|
echo ', lib = {' >> manifest.tmp
|
||||||
|
find $drv/lib/ -type f -name '*.lib.so' -printf '%f "%p"\n' \
|
||||||
|
| awk '{print ", "gensub(/.lib.so/, "", 1, $1)" = { mapKey = \""$1"\", mapValue = "$2" }" }'>> manifest.tmp
|
||||||
|
echo '}' >> manifest.tmp
|
||||||
|
fi
|
||||||
|
if [ -d $drv/tar ]; then
|
||||||
|
echo ', tar = {' >> manifest.tmp
|
||||||
|
find $drv/tar/ -type f -name '*.tar' -printf '%f "%p"\n' \
|
||||||
|
| awk '{print ""gensub(/.tar/, "", 1, $1)" = { mapKey = \""$1"\", mapValue = "$2" }" }'>> manifest.tmp
|
||||||
|
echo '}' >> manifest.tmp
|
||||||
|
fi
|
||||||
|
echo '}' >> manifest.tmp
|
||||||
|
dhall < manifest.tmp > $manifest
|
||||||
'';
|
'';
|
||||||
meta = {
|
meta = {
|
||||||
license = [ "LicenseRef-Genode" ];
|
license = [ "LicenseRef-Genode" ];
|
||||||
|
|
Loading…
Reference in New Issue