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"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1689068808,
|
"lastModified": 1731533236,
|
||||||
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
|
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
|
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -20,11 +20,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1690716044,
|
"lastModified": 1764934844,
|
||||||
"narHash": "sha256-5rhZK0YMQOK+FaOC72leFXUFuCBxKH5SRzUQqpePqQE=",
|
"narHash": "sha256-P+MyCHPVEXUB7j1lQCjWo6Ke9/SGkKCWbyyVeXkude8=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "b1b263e5f7f899704c6b592f2096bc8f719dc181",
|
"rev": "1177aa56e17909379c74d86c60d51f92f2f1e8e4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
34
jdk.nix
34
jdk.nix
@@ -1,18 +1,22 @@
|
|||||||
{ buildPlatform, hostPlatform, jdk17, which, zip, buildPackages }:
|
{
|
||||||
|
stdenv,
|
||||||
if buildPlatform == hostPlatform
|
jdk21,
|
||||||
then jdk17
|
which,
|
||||||
else (jdk17.override {
|
zip,
|
||||||
# libIDL does not compile in cross-compile scenarios.
|
buildPackages,
|
||||||
enableGnome2 = false;
|
}:
|
||||||
}).overrideAttrs (old: {
|
if stdenv.buildPlatform == stdenv.hostPlatform
|
||||||
|
then jdk21
|
||||||
|
else
|
||||||
|
jdk21.overrideAttrs (old: {
|
||||||
# lol, nixpkgs can’t get pkgs right
|
# lol, nixpkgs can’t get pkgs right
|
||||||
# AUTOCONF = "${autoconf}/bin/autoconf";
|
# AUTOCONF = "${autoconf}/bin/autoconf";
|
||||||
nativeBuildInputs = old.nativeBuildInputs ++ [ which zip ];
|
nativeBuildInputs = old.nativeBuildInputs ++ [which zip];
|
||||||
depsBuildBuild = with buildPackages; [ stdenv.cc autoconf ];
|
depsBuildBuild = with buildPackages; [stdenv.cc autoconf];
|
||||||
configureFlags = old.configureFlags ++ [
|
configureFlags =
|
||||||
|
old.configureFlags
|
||||||
|
++ [
|
||||||
"--with-jtreg=no"
|
"--with-jtreg=no"
|
||||||
"--disable-hotspot-gtest"
|
"--with-build-jdk=${buildPackages.jdk21}"
|
||||||
"--with-build-jdk=${buildPackages.jdk17}"
|
];
|
||||||
];
|
})
|
||||||
})
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
4d48c0086d14525b05a59e4209270edb90a967ea271b80694e243caa2eea69c2
|
0da4a8887afe0b4c9808f35cc033290f608c25eb99bcf6943e73ab59e78894d0
|
||||||
111
openhab.nix
111
openhab.nix
@@ -1,66 +1,75 @@
|
|||||||
{
|
{
|
||||||
bash,
|
bash,
|
||||||
coreutils,
|
coreutils,
|
||||||
fetchurl,
|
fetchurl,
|
||||||
gawk,
|
gawk,
|
||||||
jdk-openhab,
|
jdk-openhab,
|
||||||
lib,
|
lib,
|
||||||
makeWrapper,
|
makeWrapper,
|
||||||
procps,
|
procps,
|
||||||
stdenv,
|
zip,
|
||||||
}:
|
unzip,
|
||||||
|
stdenv,
|
||||||
let
|
gnused,
|
||||||
version = builtins.readFile ./version;
|
}: let
|
||||||
sha256 = builtins.readFile ./openhab.sha256;
|
version = builtins.readFile ./version;
|
||||||
in stdenv.mkDerivation rec {
|
sha256 = builtins.readFile ./openhab.sha256;
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
inherit version;
|
inherit version;
|
||||||
pname = "openhab";
|
pname = "openhab";
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://github.com/openhab/openhab-distro/releases/download/${version}/openhab-${version}.tar.gz";
|
url = "https://github.com/openhab/openhab-distro/releases/download/${version}/openhab-${version}.tar.gz";
|
||||||
inherit sha256;
|
inherit sha256;
|
||||||
};
|
};
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
nativeBuildInputs = [makeWrapper gnused];
|
||||||
buildInputs = [ bash ];
|
buildInputs = [bash];
|
||||||
outputs = [ "out" ];
|
outputs = ["out"];
|
||||||
extraPath = lib.makeBinPath [ jdk-openhab gawk coreutils procps ];
|
extraPath = lib.makeBinPath [jdk-openhab gawk coreutils procps zip unzip];
|
||||||
wrappedExecutables = [
|
wrappedExecutables = [
|
||||||
"start.sh"
|
"start.sh"
|
||||||
"start_debug.sh"
|
"start_debug.sh"
|
||||||
"runtime/bin/karaf"
|
"runtime/bin/karaf"
|
||||||
"runtime/bin/backup"
|
"runtime/bin/backup"
|
||||||
"runtime/bin/client"
|
"runtime/bin/client"
|
||||||
"runtime/bin/instance"
|
"runtime/bin/instance"
|
||||||
"runtime/bin/karaf"
|
"runtime/bin/karaf"
|
||||||
"runtime/bin/restore"
|
"runtime/bin/restore"
|
||||||
"runtime/bin/shell"
|
"runtime/bin/shell"
|
||||||
"runtime/bin/start"
|
"runtime/bin/start"
|
||||||
"runtime/bin/status"
|
"runtime/bin/status"
|
||||||
"runtime/bin/stop"
|
"runtime/bin/stop"
|
||||||
"runtime/bin/update"
|
"runtime/bin/update"
|
||||||
];
|
];
|
||||||
|
|
||||||
unpackPhase = ''
|
unpackPhase = ''
|
||||||
runHook preUnpack
|
runHook preUnpack
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
tar -C $out -xf $src
|
tar -C $out -xf $src
|
||||||
runHook postUnpack
|
runHook postUnpack
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
rm -rfv \
|
rm -rfv \
|
||||||
"$out/"*.bat \
|
"$out/"*.bat \
|
||||||
"$out/runtime/bin/"*.bat \
|
"$out/runtime/bin/"*.bat \
|
||||||
"$out/runtime/bin/"*.ps1 \
|
"$out/runtime/bin/"*.ps1 \
|
||||||
"$out/runtime/bin/"*.psm1 \
|
"$out/runtime/bin/"*.psm1
|
||||||
"$out/runtime/bin/"*.lst
|
|
||||||
|
|
||||||
for exe in $wrappedExecutables; do
|
for exe in $wrappedExecutables; do
|
||||||
echo "Wrapping $exe…"
|
echo "Rewriting $exe…"
|
||||||
wrapProgram $out/$exe --prefix PATH ':' $extraPath
|
cat - $out/$exe > "$out/$exe".new << EOF
|
||||||
done
|
#!${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