first try of packaging circuitjs

This commit is contained in:
Rouven Seifert 2023-05-18 21:51:15 +02:00
parent 0921151c6e
commit 98dcbcd724
Signed by: rouven.seifert
GPG key ID: B95E8FE6B11C4D09
4 changed files with 77 additions and 4 deletions

View file

@ -179,11 +179,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1684305980, "lastModified": 1684385584,
"narHash": "sha256-vd4SKXX1KZfSX6n3eoguJw/vQ+sBL8XGdgfxjEgLpKc=", "narHash": "sha256-O7y0gK8OLIDqz+LaHJJyeu09IGiXlZIS3+JgEzGmmJA=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "e6e389917a8c778be636e67a67ec958f511cc55d", "rev": "48a0fb7aab511df92a17cf239c37f2bd2ec9ae3a",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -46,6 +46,7 @@
}@attrs: { }@attrs: {
packages.x86_64-linux.iso = self.nixosConfigurations.iso.config.system.build.isoImage; packages.x86_64-linux.iso = self.nixosConfigurations.iso.config.system.build.isoImage;
packages.x86_64-linux.jmri = nixpkgs.legacyPackages.x86_64-linux.callPackage ./pkgs/jmri { }; packages.x86_64-linux.jmri = nixpkgs.legacyPackages.x86_64-linux.callPackage ./pkgs/jmri { };
# packages.x86_64-linux.circuitjs = nixpkgs.legacyPackages.x86_64-linux.callPackage ./pkgs/circuitjs { };
hydraJobs = self.packages; hydraJobs = self.packages;
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt; formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
nixosConfigurations = { nixosConfigurations = {

View file

@ -0,0 +1,72 @@
{ stdenv, fetchurl, makeWrapper, wrapGAppsHook, lib, libX11, libXext, gtk3-x11, dbus, nspr, alsa-lib, glib, expat, gdk-pixbuf, mesa, xorg, nss, cups, ffmpeg, cairo, pango, at-spi2-atk, atk, at-spi2-core, libdrm, ... }:
stdenv.mkDerivation rec {
pname = "circuitjs";
version = "2.8.0";
src = fetchurl {
url = "https://www.falstad.com/circuit/offline/circuitjs1-linux64.tgz";
hash = "sha256-dyIEuDA7FRwHCok41wcJAr8eqksJSOdChafPPh0Q3zM=";
};
nativeBuildInputs = [ makeWrapper wrapGAppsHook ];
sourceRoot = ".";
dontBuild = true;
dontStrip = true;
dontPatchELF = true;
libPath = lib.makeLibraryPath [
libX11
libXext
alsa-lib
xorg.libXi
xorg.libXrender
xorg.libXfixes
xorg.libXtst
xorg.libXcomposite
xorg.libXcursor
xorg.libXrandr
xorg.libXdamage
xorg.libxcb
xorg.libXScrnSaver
nss
ffmpeg.lib
cups
pango
cairo
nspr
atk
libdrm
glib
dbus
gtk3-x11
mesa
expat
gdk-pixbuf
];
# wrapProgramShell $out/opt/circuitjs1 \
# "''${gappsWrapperArgs[@]}" \
# --prefix LD_LIBRARY_PATH : ${libPath}:$out/lib \
installPhase = ''
mkdir -p $out/
cp -r circuitjs1 $out/opt
mkdir -p $out/lib
cp circuitjs1/lib* $out/lib
mkdir -p $out/bin
ln -sf $out/opt/circuitjs1 $out/bin/circuitjs1
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${libPath}":$out/lib \
$out/bin/circuitjs1
'';
meta = with lib; {
# inherit homepage;
description = "Falstad circuit simulator";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
# license = licenses.unfree;
platforms = platforms.linux;
maintainers = [ maintainers.therealr5 ];
};
}

View file

@ -38,7 +38,7 @@
# yubikey and password stuff # yubikey and password stuff
yubikey-manager yubikey-manager
yubikey-manager-qt yubikey-manager-qt
# yubioath-flutter # broken, TODO fix yubioath-flutter
bitwarden bitwarden
# misc # misc