about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--maintainers/maintainer-list.nix6
-rw-r--r--pkgs/applications/science/electronics/hal-hardware-analyzer/default.nix52
-rw-r--r--pkgs/development/compilers/ghc/8.8.3.nix5
-rw-r--r--pkgs/development/haskell-modules/generic-builder.nix6
-rw-r--r--pkgs/development/python-modules/freetype-py/default.nix31
-rw-r--r--pkgs/development/python-modules/freetype-py/library-paths.patch37
-rw-r--r--pkgs/development/python-modules/vispy/default.nix40
-rw-r--r--pkgs/development/python-modules/vispy/library-paths.patch39
-rw-r--r--pkgs/tools/graphics/grim/default.nix4
-rw-r--r--pkgs/tools/misc/dijo/default.nix22
-rw-r--r--pkgs/top-level/all-packages.nix6
-rw-r--r--pkgs/top-level/python-packages.nix4
12 files changed, 247 insertions, 5 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index 4a10f51c20e7..b9c93d878156 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -3064,6 +3064,12 @@
     githubId = 25820499;
     name = "Roman Kretschmer";
   };
+  goertzenator = {
+    email = "daniel.goertzen@gmail.com";
+    github = "goertzenator";
+    githubId = 605072;
+    name = "Daniel Goertzen";
+  };
   goibhniu = {
     email = "cillian.deroiste@gmail.com";
     github = "cillianderoiste";
diff --git a/pkgs/applications/science/electronics/hal-hardware-analyzer/default.nix b/pkgs/applications/science/electronics/hal-hardware-analyzer/default.nix
new file mode 100644
index 000000000000..06053a8f356b
--- /dev/null
+++ b/pkgs/applications/science/electronics/hal-hardware-analyzer/default.nix
@@ -0,0 +1,52 @@
+{ stdenv, fetchFromGitHub, cmake, ninja, pkgconfig, python3Packages
+, boost, rapidjson, qtbase, qtsvg, igraph, spdlog, wrapQtAppsHook
+, llvmPackages ? null
+}:
+
+stdenv.mkDerivation rec {
+  version = "2.0.0";
+  pname = "hal-hardware-analyzer";
+
+  src = fetchFromGitHub {
+    owner = "emsec";
+    repo = "hal";
+    rev = "v${version}";
+    sha256 = "11xmqxnryksl645wmm1d69k1b5zwvxxf0admk4iblzaa3ggf7cv1";
+  };
+  # make sure bundled dependencies don't get in the way - install also otherwise
+  # copies them in full to the output, bloating the package
+  postPatch = ''
+    rm -rf deps/*/*
+    substituteInPlace cmake/detect_dependencies.cmake \
+      --replace 'spdlog 1.4.2 EXACT' 'spdlog 1.4.2 REQUIRED'
+  '';
+
+  nativeBuildInputs = [ cmake ninja pkgconfig ];
+  buildInputs = [ qtbase qtsvg boost rapidjson igraph spdlog wrapQtAppsHook ]
+    ++ (with python3Packages; [ python pybind11 ])
+    ++ stdenv.lib.optional stdenv.cc.isClang llvmPackages.openmp;
+
+  cmakeFlags = with stdenv.lib.versions; [
+    "-DHAL_VERSION_RETURN=${version}"
+    "-DHAL_VERSION_MAJOR=${major version}"
+    "-DHAL_VERSION_MINOR=${minor version}"
+    "-DHAL_VERSION_PATCH=${patch version}"
+    "-DHAL_VERSION_TWEAK=0"
+    "-DHAL_VERSION_ADDITIONAL_COMMITS=0"
+    "-DHAL_VERSION_DIRTY=false"
+    "-DHAL_VERSION_BROKEN=false"
+    "-DENABLE_INSTALL_LDCONFIG=off"
+    "-DBUILD_ALL_PLUGINS=on"
+  ];
+  # needed for macos build - this is why we use wrapQtAppsHook instead of
+  # the qt mkDerivation - the latter forcibly overrides this.
+  cmakeBuildType = "MinSizeRel";
+
+  meta = {
+    description = "A comprehensive reverse engineering and manipulation framework for gate-level netlists";
+    homepage = "https://github.com/emsec/hal";
+    license = stdenv.lib.licenses.mit;
+    platforms = with stdenv.lib.platforms; unix;
+    maintainers = with stdenv.lib.maintainers; [ ris ];
+  };
+}
diff --git a/pkgs/development/compilers/ghc/8.8.3.nix b/pkgs/development/compilers/ghc/8.8.3.nix
index b199dc34fa37..c22327efce36 100644
--- a/pkgs/development/compilers/ghc/8.8.3.nix
+++ b/pkgs/development/compilers/ghc/8.8.3.nix
@@ -30,6 +30,9 @@
 , # Whether to build terminfo.
   enableTerminfo ? !stdenv.targetPlatform.isWindows
 
+  # aarch64 outputs otherwise exceed 2GB limit
+, enableProfiliedLibs ? !stdenv.targetPlatform.isAarch64
+
 , # What flavour to build. An empty string indicates no
   # specific flavour and falls back to ghc default values.
   ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
@@ -65,6 +68,8 @@ let
     HADDOCK_DOCS = NO
     BUILD_SPHINX_HTML = NO
     BUILD_SPHINX_PDF = NO
+  '' + stdenv.lib.optionalString (!enableProfiliedLibs) ''
+    GhcLibWays = "v dyn"
   '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
     GhcLibHcOpts += -fPIC
     GhcRtsHcOpts += -fPIC
diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix
index de5bf631bf0d..20fa2c840629 100644
--- a/pkgs/development/haskell-modules/generic-builder.nix
+++ b/pkgs/development/haskell-modules/generic-builder.nix
@@ -27,7 +27,8 @@ in
 , doHoogle ? true
 , doHaddockQuickjump ? doHoogle && stdenv.lib.versionAtLeast ghc.version "8.6"
 , editedCabalFile ? null
-, enableLibraryProfiling ? !(ghc.isGhcjs or false)
+# aarch64 outputs otherwise exceed 2GB limit
+, enableLibraryProfiling ? !(ghc.isGhcjs or stdenv.targetPlatform.isAarch64 or false)
 , enableExecutableProfiling ? false
 , profilingDetail ? "exported-functions"
 # TODO enable shared libs for cross-compiling
@@ -48,8 +49,7 @@ in
 , isExecutable ? false, isLibrary ? !isExecutable
 , jailbreak ? false
 , license
-  # aarch64 sometimes crashes for -jn with n>1: https://ghc.haskell.org/trac/ghc/ticket/15449
-, enableParallelBuilding ? !stdenv.buildPlatform.isAarch64
+, enableParallelBuilding ? true
 , maintainers ? []
 , doCoverage ? false
 , doHaddock ? !(ghc.isHaLVM or false)
diff --git a/pkgs/development/python-modules/freetype-py/default.nix b/pkgs/development/python-modules/freetype-py/default.nix
new file mode 100644
index 000000000000..a1259b85673a
--- /dev/null
+++ b/pkgs/development/python-modules/freetype-py/default.nix
@@ -0,0 +1,31 @@
+{ lib, buildPythonPackage, fetchPypi, substituteAll, stdenv, setuptools_scm, freetype }:
+
+buildPythonPackage rec {
+  pname = "freetype-py";
+  version = "2.1.0.post1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1k62fx53qrv9nb73mpqi2r11wzbx41qfv5qppvh6rylywnrknf3n";
+  };
+
+  patches = [
+    (substituteAll {
+      src = ./library-paths.patch;
+      freetype = "${freetype.out}/lib/libfreetype${stdenv.hostPlatform.extensions.sharedLibrary}";
+    })
+  ];
+
+  nativeBuildInputs = [ setuptools_scm ];
+
+  propagatedBuildInputs = [ freetype ];
+
+  pythonImportsCheck =  [ "freetype" ];
+
+  meta = with lib; {
+    homepage = "https://github.com/rougier/freetype-py";
+    description = "FreeType (high-level Python API)";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ goertzenator ];
+  };
+}
diff --git a/pkgs/development/python-modules/freetype-py/library-paths.patch b/pkgs/development/python-modules/freetype-py/library-paths.patch
new file mode 100644
index 000000000000..a30c7e7355fa
--- /dev/null
+++ b/pkgs/development/python-modules/freetype-py/library-paths.patch
@@ -0,0 +1,37 @@
+diff --git a/freetype/raw.py b/freetype/raw.py
+index ff3bea3..78c68ab 100644
+--- a/freetype/raw.py
++++ b/freetype/raw.py
+@@ -19,31 +19,7 @@ from freetype.ft_enums import *
+ from freetype.ft_errors import *
+ from freetype.ft_structs import *
+ 
+-# First, look for a bundled FreeType shared object on the top-level of the
+-# installed freetype-py module.
+-system = platform.system()
+-if system == 'Windows':
+-    library_name = 'libfreetype.dll'
+-elif system == 'Darwin':
+-    library_name = 'libfreetype.dylib'
+-else:
+-    library_name = 'libfreetype.so'
+-
+-filename = os.path.join(os.path.dirname(freetype.__file__), library_name)
+-
+-# If no bundled shared object is found, look for a system-wide installed one.
+-if not os.path.exists(filename):
+-    # on windows all ctypes does when checking for the library
+-    # is to append .dll to the end and look for an exact match
+-    # within any entry in PATH.
+-    filename = ctypes.util.find_library('freetype')
+-
+-    if filename is None:
+-        if platform.system() == 'Windows':
+-            # Check current working directory for dll as ctypes fails to do so
+-            filename = os.path.join(os.path.realpath('.'), "freetype.dll")
+-        else:
+-            filename = library_name
++filename = "@freetype@"
+ 
+ try:
+     _lib = ctypes.CDLL(filename)
diff --git a/pkgs/development/python-modules/vispy/default.nix b/pkgs/development/python-modules/vispy/default.nix
new file mode 100644
index 000000000000..029132933a9b
--- /dev/null
+++ b/pkgs/development/python-modules/vispy/default.nix
@@ -0,0 +1,40 @@
+{ lib, buildPythonPackage, substituteAll, stdenv,
+  fetchPypi, numpy, cython, freetype-py, fontconfig, libGL,
+  setuptools_scm, setuptools-scm-git-archive
+  }:
+
+buildPythonPackage rec {
+  pname = "vispy";
+  version = "0.6.4";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "07sb4qww6mgzm66qsrr3pd66yz39r6jj4ibb3qmfg1kwnxs6ayv2";
+  };
+
+  patches = [
+    (substituteAll {
+      src = ./library-paths.patch;
+      fontconfig = "${fontconfig.lib}/lib/libfontconfig${stdenv.hostPlatform.extensions.sharedLibrary}";
+      gl = "${libGL.out}/lib/libGL${stdenv.hostPlatform.extensions.sharedLibrary}";
+    })
+  ];
+
+  nativeBuildInputs = [
+    cython setuptools_scm setuptools-scm-git-archive
+  ];
+
+  propagatedBuildInputs = [
+    numpy freetype-py fontconfig libGL
+  ];
+
+  doCheck = false;  # otherwise runs OSX code on linux.
+  pythonImportsCheck = [ "vispy" ];
+
+  meta = with lib; {
+    homepage = "http://vispy.org/index.html";
+    description = "Interactive scientific visualization in Python";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ goertzenator ];
+  };
+}
diff --git a/pkgs/development/python-modules/vispy/library-paths.patch b/pkgs/development/python-modules/vispy/library-paths.patch
new file mode 100644
index 000000000000..05b583c12e4f
--- /dev/null
+++ b/pkgs/development/python-modules/vispy/library-paths.patch
@@ -0,0 +1,39 @@
+diff --git a/vispy/ext/fontconfig.py b/vispy/ext/fontconfig.py
+index ff24662b..6a5079f0 100644
+--- a/vispy/ext/fontconfig.py
++++ b/vispy/ext/fontconfig.py
+@@ -7,10 +7,7 @@ from ..util.wrappers import run_subprocess
+ 
+ # Some code adapted from Pyglet
+ 
+-fc = util.find_library('fontconfig')
+-if fc is None:
+-    raise ImportError('fontconfig not found')
+-fontconfig = cdll.LoadLibrary(fc)
++fontconfig = cdll.LoadLibrary('@fontconfig@')
+ 
+ FC_FAMILY = 'family'.encode('ASCII')
+ FC_SIZE = 'size'.encode('ASCII')
+diff --git a/vispy/gloo/gl/gl2.py b/vispy/gloo/gl/gl2.py
+index d5bd9c38..63350e73 100644
+--- a/vispy/gloo/gl/gl2.py
++++ b/vispy/gloo/gl/gl2.py
+@@ -39,16 +39,8 @@ elif sys.platform.startswith('win'):
+         pass
+ else:
+     # Unix-ish
+-    if sys.platform.startswith('darwin'):
+-        _fname = ctypes.util.find_library('OpenGL')
+-    else:
+-        _fname = ctypes.util.find_library('GL')
+-    if not _fname:
+-        logger.warning('Could not load OpenGL library.')
+-        _lib = None
+-    else:
+-        # Load lib
+-        _lib = ctypes.cdll.LoadLibrary(_fname)
++    # Load lib
++    _lib = ctypes.cdll.LoadLibrary("@gl@")
+ 
+ 
+ def _have_context():
diff --git a/pkgs/tools/graphics/grim/default.nix b/pkgs/tools/graphics/grim/default.nix
index ab0418bd0dc6..a357277ed12e 100644
--- a/pkgs/tools/graphics/grim/default.nix
+++ b/pkgs/tools/graphics/grim/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "grim";
-  version = "1.3.0";
+  version = "1.3.1";
 
   src = fetchFromGitHub {
     owner = "emersion";
     repo = pname;
     rev = "v${version}";
-    sha256 = "14gqilgd27c4j2wn7fla72yj8syx0542rsanh61syikrv0hxgkvy";
+    sha256 = "0fjmjq0ws9rlblkcqxxw2lv7zvvyi618jqzlnz5z9zb477jwdfib";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/tools/misc/dijo/default.nix b/pkgs/tools/misc/dijo/default.nix
new file mode 100644
index 000000000000..5f58e8002282
--- /dev/null
+++ b/pkgs/tools/misc/dijo/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, lib, rustPlatform, fetchFromGitHub, ncurses, CoreServices }:
+let version = "0.1.5"; in
+rustPlatform.buildRustPackage {
+  pname = "dijo";
+  inherit version;
+  buildInputs = [ ncurses ] ++ lib.optional stdenv.isDarwin CoreServices;
+  src = fetchFromGitHub {
+    owner = "NerdyPepper";
+    repo = "dijo";
+    rev = "v${version}";
+    sha256 = "1ch320j2d66zn9mbs7xl0bkfcm2hpak6izk0yspz1gcji1l7grsc";
+  };
+  cargoSha256 = "1p6apz3wd4gqp0z24ygfw8nmpkh44d000jp6x7svqzmpphnmb0ji";
+
+  meta = with lib; {
+    description = "Scriptable, curses-based, digital habit tracker.";
+    homepage = "https://github.com/NerdyPepper/dijo";
+    license = licenses.mit;
+    maintainers = with maintainers; [ infinisil ];
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 2551ddfde50a..74efc6ad3202 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1707,6 +1707,10 @@ in
     inherit (darwin.apple_sdk.frameworks) Security;
   };
 
+  dijo = callPackage ../tools/misc/dijo {
+    inherit (darwin.apple_sdk.frameworks) CoreServices;
+  };
+
   ding = callPackage ../applications/misc/ding {
     aspellDicts_de = aspellDicts.de;
     aspellDicts_en = aspellDicts.en;
@@ -4146,6 +4150,8 @@ in
 
   hal-flash = callPackage ../os-specific/linux/hal-flash { };
 
+  hal-hardware-analyzer = libsForQt5.callPackage ../applications/science/electronics/hal-hardware-analyzer { };
+
   half = callPackage ../development/libraries/half { };
 
   halibut = callPackage ../tools/typesetting/halibut { };
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index ebf2585bfffe..83672a227ed7 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -766,6 +766,8 @@ in {
 
   foxdot = callPackage ../development/python-modules/foxdot { };
 
+  freetype-py = callPackage ../development/python-modules/freetype-py { };
+
   fsspec = callPackage ../development/python-modules/fsspec { };
 
   furl = callPackage ../development/python-modules/furl { };
@@ -6242,6 +6244,8 @@ in {
 
   virtualenv = callPackage ../development/python-modules/virtualenv { };
 
+  vispy = callPackage ../development/python-modules/vispy { };
+
   vsts = callPackage ../development/python-modules/vsts { };
 
   vsts-cd-manager = callPackage ../development/python-modules/vsts-cd-manager { };