nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchsvn,
5 wrapQtAppsHook,
6 qtbase,
7 qttools,
8 qmake,
9 bison,
10 flex,
11}:
12stdenv.mkDerivation {
13 pname = "qtspim";
14 version = "9.1.23";
15
16 src = fetchsvn {
17 url = "https://svn.code.sf.net/p/spimsimulator/code/";
18 rev = "r749";
19 sha256 = "0iazl7mlcilrdbw8gb98v868a8ldw2lmkn1xs8hnfvr93l6aj0rp";
20 };
21
22 postPatch = ''
23 cd QtSpim
24
25 substituteInPlace QtSpim.pro --replace /usr/lib/qtspim/lib $out/lib
26 substituteInPlace menu.cpp \
27 --replace /usr/lib/qtspim/bin/assistant ${qttools.dev}/bin/assistant \
28 --replace /usr/lib/qtspim/help/qtspim.qhc $out/share/help/qtspim.qhc
29 substituteInPlace ../Setup/qtspim_debian_deployment/qtspim.desktop \
30 --replace /usr/bin/qtspim qtspim \
31 --replace /usr/lib/qtspim/qtspim.png qtspim
32 '';
33
34 nativeBuildInputs = [
35 wrapQtAppsHook
36 qttools
37 qmake
38 bison
39 flex
40 ];
41 buildInputs = [ qtbase ];
42 QT_PLUGIN_PATH = "${qtbase}/${qtbase.qtPluginPrefix}";
43
44 qmakeFlags = [
45 "QtSpim.pro"
46 "-spec"
47 "linux-g++"
48 "CONFIG+=release"
49 ];
50
51 installPhase = ''
52 runHook preInstall
53
54 install -D QtSpim $out/bin/qtspim
55 install -D ../Setup/qtspim_debian_deployment/copyright $out/share/licenses/qtspim/copyright
56 install -D ../Setup/qtspim_debian_deployment/qtspim.desktop $out/share/applications/qtspim.desktop
57 install -D ../Setup/NewIcon48x48.png $out/share/icons/hicolor/48x48/apps/qtspim.png
58 install -D ../Setup/NewIcon256x256.png $out/share/icons/hicolor/256x256/apps/qtspim.png
59 cp -r help $out/share/help
60
61 runHook postInstall
62 '';
63
64 meta = {
65 description = "New user interface for spim, a MIPS simulator";
66 mainProgram = "qtspim";
67 homepage = "https://spimsimulator.sourceforge.net/";
68 license = lib.licenses.bsdOriginal;
69 maintainers = with lib.maintainers; [ emilytrau ];
70 platforms = lib.platforms.linux;
71 };
72}