From 7f3f24555015b84ff915a461b8b59056b7cc7529 Mon Sep 17 00:00:00 2001 From: tdro Date: Thu, 13 Apr 2023 23:11:08 -0400 Subject: .config/nixpkgs: Cleanup debt Move deprecated applications to shell --- .../nixpkgs/shells/mermaid-live-editor/shell.nix | 75 +++++++++++++++++ .config/nixpkgs/shells/planner/shell.nix | 68 +++++++++++++++ .config/nixpkgs/shells/scribus/shell.nix | 96 ++++++++++++++++++++++ .config/nixpkgs/shells/tilp2/shell.nix | 66 +++++++++++++++ 4 files changed, 305 insertions(+) create mode 100644 .config/nixpkgs/shells/mermaid-live-editor/shell.nix create mode 100644 .config/nixpkgs/shells/planner/shell.nix create mode 100644 .config/nixpkgs/shells/scribus/shell.nix create mode 100644 .config/nixpkgs/shells/tilp2/shell.nix (limited to '.config/nixpkgs/shells') diff --git a/.config/nixpkgs/shells/mermaid-live-editor/shell.nix b/.config/nixpkgs/shells/mermaid-live-editor/shell.nix new file mode 100644 index 0000000..bf9b33a --- /dev/null +++ b/.config/nixpkgs/shells/mermaid-live-editor/shell.nix @@ -0,0 +1,75 @@ +let + + name = "nix-shell.mermaid-live-editor"; + version = "bf6c54c00e84d8c7d541920607db72f50d775ba5"; + + pkgs = import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/22.11/nixos-22.11.466.596a8e828c5/nixexprs.tar.xz"; + sha256 = "1367bad5zz0mfm4czb6p0s0ni38f0x1ffh02z76rx4nranipqbgg"; + }) { }; + + package = pkgs.callPackage ({ lib, stdenv, fetchgit, mkYarnModules }: + + stdenv.mkDerivation rec { + inherit version; + pname = "mermaid-live-editor-node-modules"; + + src = fetchgit { + rev = version; + url = "https://github.com/mermaid-js/mermaid-live-editor.git"; + sha256 = "sha256-SadZzBruGKh4LCR9vr87vl/HBEgVN8Qczi9+thGmNCE="; + }; + + node_modules = mkYarnModules { + inherit pname version; + yarnLock = "${src}/yarn.lock"; + packageJSON = "${src}/package.json"; + }; + + installPhase = '' + runHook preInstall + mkdir $out + cp --recursive --no-target-directory ${node_modules} $out + cd $out/node_modules + chmod +w . + ln --symbolic mermaid-live-editor/node_modules/svelte-preprocess . + runHook postInstall + ''; + + meta = with lib; { + homepage = url; + license = licenses.mit; + description = "Edit, preview and share mermaid charts/diagrams. New implementation of the live editor."; + }; + }) { }; + + shell = pkgs.writeShellApplication { + inherit name; + text = '' + /usr/bin/env --ignore-environment /bin/sh -c ${ + pkgs.writeScript name '' + export PS1='\h (${name}) \W \$ ' + export PATH=${ + pkgs.lib.strings.makeBinPath [ + package + pkgs.busybox + pkgs.chromium + pkgs.git + pkgs.yarn + ] + } + git clone https://github.com/mermaid-js/mermaid-live-editor.git + cd mermaid-live-editor + git checkout '${version}' + ln -sf '${package}/node_modules' + stat .svelte-kit || yarn build + yarn preview + '' + }; + ''; + }; + +in pkgs.mkShell { + inherit name; + shellHook = "exec ${shell}/bin/${shell.name}"; +} diff --git a/.config/nixpkgs/shells/planner/shell.nix b/.config/nixpkgs/shells/planner/shell.nix new file mode 100644 index 0000000..079beda --- /dev/null +++ b/.config/nixpkgs/shells/planner/shell.nix @@ -0,0 +1,68 @@ +let + + name = "nix-shell.planner"; + + pkgs = (import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/21.11/nixos-21.11.336020.2128d0aa28e/nixexprs.tar.xz"; + sha256 = "0w8plbxms0di6gnh0k2yhj0pgxzxas7g5x0m01zjzixf16i2bapj"; + }) { }); + + package = pkgs.callPackage ({ lib, stdenvNoCC, fetchgit, pkgconfig, intltool + , automake111x, autoconf, libtool, gnome2, libxslt, python2, gcc48 }: + stdenvNoCC.mkDerivation rec { + pname = "planner"; + version = "de43d655f9f8103993129cde9de3d0e080d0546c"; + src = fetchgit { + url = "https://gitlab.gnome.org/World/planner.git"; + sha256 = "1zpcswdpcjhllk7phy3z1zyxcgqr4pp0vf5fgpg5f3gqpk4xvwyg"; + rev = version; + }; + nativeBuildInputs = [ + autoconf + automake111x + gnome2.gnome-common + gnome2.gtk-doc + gnome2.scrollkeeper + intltool + libtool + pkgconfig + ]; + buildInputs = [ + gcc48 + gnome2.GConf + gnome2.gtk + gnome2.libglade + gnome2.libgnomecanvas + gnome2.libgnomeui + libxslt + python2.pkgs.pygtk + ]; + enableParallelBuilding = true; + preConfigure = "./autogen.sh"; + makeFlags = [ "CFLAGS=-DGLIB_DISABLE_DEPRECATION_WARNINGS" ]; + configureFlags = [ "--enable-python" "--enable-python-plugin" ]; + meta = with lib; { + description = "Project management application for GNOME"; + homepage = "https://wiki.gnome.org/Apps/Planner"; + license = licenses.gpl2Plus; + platforms = platforms.all; + }; + }) { }; + + shell = pkgs.writeShellApplication { + inherit name; + text = '' + /usr/bin/env --ignore-environment /bin/sh -c ${ + pkgs.writeScript name '' + export PS1='\h (${name}) \W \$ ' + export PATH=${pkgs.lib.strings.makeBinPath [ package pkgs.busybox ]} + /bin/sh + '' + }; + ''; + }; + +in pkgs.mkShell { + inherit name package; + shellHook = "exec ${shell}/bin/${shell.name}"; +} diff --git a/.config/nixpkgs/shells/scribus/shell.nix b/.config/nixpkgs/shells/scribus/shell.nix new file mode 100644 index 0000000..9658c0a --- /dev/null +++ b/.config/nixpkgs/shells/scribus/shell.nix @@ -0,0 +1,96 @@ +let + + name = "nix-shell.scribus"; + + pkgs = (import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/21.11/nixos-21.11.336020.2128d0aa28e/nixexprs.tar.xz"; + sha256 = "0w8plbxms0di6gnh0k2yhj0pgxzxas7g5x0m01zjzixf16i2bapj"; + }) { }); + + package = pkgs.callPackage ({ lib, stdenv, fetchurl, pkg-config, freetype, lcms, libtiff + , libxml2, gnome2, qt4, python2, cups, fontconfig, libjpeg, zlib, libpng + , xorg, cairo, podofo, hunspell, boost, cmake, imagemagick, ghostscript }: + + let + icon = fetchurl { + url = "https://gist.githubusercontent.com/ejpcmac/a74b762026c9bc4000be624c3d085517/raw/18edc497c5cb6fdeef1c8aede37a0ee68413f9d3/scribus-icon-centered.svg"; + sha256 = "0hq3i7c2l50445an9glhhg47kj26y16svfajc6naqn307ph9vzc3"; + }; + pythonEnv = python2.withPackages (ps: [ ps.tkinter ps.pillow ]); + in stdenv.mkDerivation rec { + pname = "scribus"; + version = "1.4.8"; + + src = fetchurl { + url = "mirror://sourceforge/${pname}/${pname}/${pname}-${version}.tar.xz"; + sha256 = "0bq433myw6h1siqlsakxv6ghb002rp3mfz5k12bg68s0k6skn992"; + }; + + nativeBuildInputs = [ pkg-config cmake ]; + buildInputs = with xorg; [ + boost + cairo + cups + fontconfig + freetype + gnome2.libart_lgpl + hunspell + imagemagick + lcms + libX11 + libXau + libXaw + libXdmcp + libXext + libXi + libXinerama + libXtst + libjpeg + libpng + libpthreadstubs + libtiff + libxml2 + podofo + pythonEnv + qt4 + zlib + ]; + + postPatch = '' + substituteInPlace scribus/util_ghostscript.cpp \ + --replace 'QString gsName("gs");' \ + 'QString gsName("${ghostscript}/bin/gs");' + ''; + + postInstall = '' + for i in 16 24 48 64 96 128 256 512; do + mkdir -p $out/share/icons/hicolor/''${i}x''${i}/apps + convert -background none -resize ''${i}x''${i} ${icon} $out/share/icons/hicolor/''${i}x''${i}/apps/scribus.png + done + ''; + + meta = { + platforms = lib.platforms.linux; + description = "Desktop Publishing (DTP) and Layout program for Linux"; + homepage = "https://www.scribus.net"; + license = lib.licenses.gpl2; + }; + }) { }; + + shell = pkgs.writeShellApplication { + inherit name; + text = '' + /usr/bin/env --ignore-environment /bin/sh -c ${ + pkgs.writeScript name '' + export PS1='\h (${name}) \W \$ ' + export PATH=${pkgs.lib.strings.makeBinPath [ package pkgs.busybox ]} + /bin/sh + '' + }; + ''; + }; + +in pkgs.mkShell { + inherit name package; + shellHook = "exec ${shell}/bin/${shell.name}"; +} diff --git a/.config/nixpkgs/shells/tilp2/shell.nix b/.config/nixpkgs/shells/tilp2/shell.nix new file mode 100644 index 0000000..f57bc3b --- /dev/null +++ b/.config/nixpkgs/shells/tilp2/shell.nix @@ -0,0 +1,66 @@ +let + + name = "nix-shell.tilp2"; + + pkgs = (import (builtins.fetchTarball { + url = "https://releases.nixos.org/nixos/21.11/nixos-21.11.336020.2128d0aa28e/nixexprs.tar.xz"; + sha256 = "0w8plbxms0di6gnh0k2yhj0pgxzxas7g5x0m01zjzixf16i2bapj"; + }) { }); + + package = pkgs.callPackage ({ stdenv, lib, fetchurl, fetchpatch + , autoreconfHook, pkg-config, intltool, glib, gnome2, gtk2, gfm + , libticables2, libticalcs2, libticonv, libtifiles2 }: + + stdenv.mkDerivation rec { + pname = "tilp2"; + version = "1.18"; + src = fetchurl { + url = "mirror://sourceforge/tilp/${pname}-${version}.tar.bz2"; + sha256 = "0isf73bjwk06baz2gm3vpdh600gqck9ca4aqxzb089dmxriv6fkv"; + }; + + patches = fetchpatch { + name = "remove-broken-kde-support.patch"; + url = "https://aur.archlinux.org/cgit/aur.git/plain/remove-broken-kde-support.patch?h=tilp"; + sha256 = "1fn6vh7r45spkwpmkvffkbn7zrcsdrs5mjmspd5rwi3jc12cy3ny"; + }; + + nativeBuildInputs = [ autoreconfHook pkg-config intltool ]; + + buildInputs = [ + glib + gtk2 + gnome2.libglade + gfm + libticables2 + libticalcs2 + libticonv + libtifiles2 + ]; + + meta = with lib; { + changelog = "http://lpg.ticalc.org/prj_tilp/news.html"; + description = "Transfer data between Texas Instruments graphing calculators and a computer"; + homepage = "http://lpg.ticalc.org/prj_tilp/"; + license = licenses.gpl2Plus; + platforms = with platforms; linux ++ darwin; + }; + }) { }; + + shell = pkgs.writeShellApplication { + inherit name; + text = '' + /usr/bin/env --ignore-environment /bin/sh -c ${ + pkgs.writeScript name '' + export PS1='\h (${name}) \W \$ ' + export PATH=${pkgs.lib.strings.makeBinPath [ package pkgs.busybox ]} + /bin/sh + '' + }; + ''; + }; + +in pkgs.mkShell { + inherit name package; + shellHook = "exec ${shell}/bin/${shell.name}"; +} -- cgit v1.2.3