Compare commits
17 Commits
create-pul
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
206e975368
|
|||
|
75fb304107
|
|||
|
32838d386a
|
|||
|
|
3afd0cc0e4
|
||
|
|
b837236488
|
||
|
|
19315154cc
|
||
|
|
a361fb03a5
|
||
|
|
1c51cf3e1a
|
||
|
77f5d53be5
|
|||
|
|
f6ac50c914
|
||
|
a8ae8c9656
|
|||
|
|
eb7b86b8aa
|
||
|
|
a9d4720835
|
||
|
16cfb3226e
|
|||
|
c1ca49f09f
|
|||
|
|
63c1d89dda | ||
|
|
c5143fbe60 |
12
flake.lock
generated
12
flake.lock
generated
@@ -5,11 +5,11 @@
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1689068808,
|
||||
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -20,11 +20,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1690716044,
|
||||
"narHash": "sha256-5rhZK0YMQOK+FaOC72leFXUFuCBxKH5SRzUQqpePqQE=",
|
||||
"lastModified": 1764934844,
|
||||
"narHash": "sha256-P+MyCHPVEXUB7j1lQCjWo6Ke9/SGkKCWbyyVeXkude8=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b1b263e5f7f899704c6b592f2096bc8f719dc181",
|
||||
"rev": "1177aa56e17909379c74d86c60d51f92f2f1e8e4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
34
jdk.nix
34
jdk.nix
@@ -1,18 +1,22 @@
|
||||
{ buildPlatform, hostPlatform, jdk17, which, zip, buildPackages }:
|
||||
|
||||
if buildPlatform == hostPlatform
|
||||
then jdk17
|
||||
else (jdk17.override {
|
||||
# libIDL does not compile in cross-compile scenarios.
|
||||
enableGnome2 = false;
|
||||
}).overrideAttrs (old: {
|
||||
{
|
||||
stdenv,
|
||||
jdk21,
|
||||
which,
|
||||
zip,
|
||||
buildPackages,
|
||||
}:
|
||||
if stdenv.buildPlatform == stdenv.hostPlatform
|
||||
then jdk21
|
||||
else
|
||||
jdk21.overrideAttrs (old: {
|
||||
# lol, nixpkgs can’t get pkgs right
|
||||
# AUTOCONF = "${autoconf}/bin/autoconf";
|
||||
nativeBuildInputs = old.nativeBuildInputs ++ [ which zip ];
|
||||
depsBuildBuild = with buildPackages; [ stdenv.cc autoconf ];
|
||||
configureFlags = old.configureFlags ++ [
|
||||
nativeBuildInputs = old.nativeBuildInputs ++ [which zip];
|
||||
depsBuildBuild = with buildPackages; [stdenv.cc autoconf];
|
||||
configureFlags =
|
||||
old.configureFlags
|
||||
++ [
|
||||
"--with-jtreg=no"
|
||||
"--disable-hotspot-gtest"
|
||||
"--with-build-jdk=${buildPackages.jdk17}"
|
||||
];
|
||||
})
|
||||
"--with-build-jdk=${buildPackages.jdk21}"
|
||||
];
|
||||
})
|
||||
|
||||
@@ -1 +1 @@
|
||||
4d48c0086d14525b05a59e4209270edb90a967ea271b80694e243caa2eea69c2
|
||||
0da4a8887afe0b4c9808f35cc033290f608c25eb99bcf6943e73ab59e78894d0
|
||||
111
openhab.nix
111
openhab.nix
@@ -1,66 +1,75 @@
|
||||
{
|
||||
bash,
|
||||
coreutils,
|
||||
fetchurl,
|
||||
gawk,
|
||||
jdk-openhab,
|
||||
lib,
|
||||
makeWrapper,
|
||||
procps,
|
||||
stdenv,
|
||||
}:
|
||||
|
||||
let
|
||||
version = builtins.readFile ./version;
|
||||
sha256 = builtins.readFile ./openhab.sha256;
|
||||
in stdenv.mkDerivation rec {
|
||||
bash,
|
||||
coreutils,
|
||||
fetchurl,
|
||||
gawk,
|
||||
jdk-openhab,
|
||||
lib,
|
||||
makeWrapper,
|
||||
procps,
|
||||
zip,
|
||||
unzip,
|
||||
stdenv,
|
||||
gnused,
|
||||
}: let
|
||||
version = builtins.readFile ./version;
|
||||
sha256 = builtins.readFile ./openhab.sha256;
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
inherit version;
|
||||
pname = "openhab";
|
||||
src = fetchurl {
|
||||
url = "https://github.com/openhab/openhab-distro/releases/download/${version}/openhab-${version}.tar.gz";
|
||||
inherit sha256;
|
||||
url = "https://github.com/openhab/openhab-distro/releases/download/${version}/openhab-${version}.tar.gz";
|
||||
inherit sha256;
|
||||
};
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ bash ];
|
||||
outputs = [ "out" ];
|
||||
extraPath = lib.makeBinPath [ jdk-openhab gawk coreutils procps ];
|
||||
nativeBuildInputs = [makeWrapper gnused];
|
||||
buildInputs = [bash];
|
||||
outputs = ["out"];
|
||||
extraPath = lib.makeBinPath [jdk-openhab gawk coreutils procps zip unzip];
|
||||
wrappedExecutables = [
|
||||
"start.sh"
|
||||
"start_debug.sh"
|
||||
"runtime/bin/karaf"
|
||||
"runtime/bin/backup"
|
||||
"runtime/bin/client"
|
||||
"runtime/bin/instance"
|
||||
"runtime/bin/karaf"
|
||||
"runtime/bin/restore"
|
||||
"runtime/bin/shell"
|
||||
"runtime/bin/start"
|
||||
"runtime/bin/status"
|
||||
"runtime/bin/stop"
|
||||
"runtime/bin/update"
|
||||
"start.sh"
|
||||
"start_debug.sh"
|
||||
"runtime/bin/karaf"
|
||||
"runtime/bin/backup"
|
||||
"runtime/bin/client"
|
||||
"runtime/bin/instance"
|
||||
"runtime/bin/karaf"
|
||||
"runtime/bin/restore"
|
||||
"runtime/bin/shell"
|
||||
"runtime/bin/start"
|
||||
"runtime/bin/status"
|
||||
"runtime/bin/stop"
|
||||
"runtime/bin/update"
|
||||
];
|
||||
|
||||
unpackPhase = ''
|
||||
runHook preUnpack
|
||||
mkdir -p $out
|
||||
tar -C $out -xf $src
|
||||
runHook postUnpack
|
||||
runHook preUnpack
|
||||
mkdir -p $out
|
||||
tar -C $out -xf $src
|
||||
runHook postUnpack
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
rm -rfv \
|
||||
"$out/"*.bat \
|
||||
"$out/runtime/bin/"*.bat \
|
||||
"$out/runtime/bin/"*.ps1 \
|
||||
"$out/runtime/bin/"*.psm1 \
|
||||
"$out/runtime/bin/"*.lst
|
||||
runHook preInstall
|
||||
rm -rfv \
|
||||
"$out/"*.bat \
|
||||
"$out/runtime/bin/"*.bat \
|
||||
"$out/runtime/bin/"*.ps1 \
|
||||
"$out/runtime/bin/"*.psm1
|
||||
|
||||
for exe in $wrappedExecutables; do
|
||||
echo "Wrapping $exe…"
|
||||
wrapProgram $out/$exe --prefix PATH ':' $extraPath
|
||||
done
|
||||
for exe in $wrappedExecutables; do
|
||||
echo "Rewriting $exe…"
|
||||
cat - $out/$exe > "$out/$exe".new << EOF
|
||||
#!${bash}/bin/sh
|
||||
export PATH="\''$PATH:$extraPath"
|
||||
EOF
|
||||
mv "$out/$exe".new "$out/$exe"
|
||||
done
|
||||
|
||||
runHook postInstall
|
||||
# Fix OPENHAB_HOME overwritting
|
||||
sed '6d' "$out/runtime/bin/oh_dir_layout" | sed '6i if [ -z ''${OPENHAB_HOME} ]; then\n export OPENHAB_HOME=`cd "$DIRNAME/../.."; pwd`\nfi' > "$out/runtime/bin/oh_dir_layout.new"
|
||||
mv "$out/runtime/bin/oh_dir_layout.new" "$out/runtime/bin/oh_dir_layout"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
aa75eb31b10a7d966f006b6358e8d5db1304e2a7912decddf3a09b3cdec615dc
|
||||
9d5d8815951d1638a4cb08d430226ec670179cbbd4620cb16d0251b4bb9f9377
|
||||
Reference in New Issue
Block a user