Unverified Commit 2d1f9c2b authored by github-actions[bot]'s avatar github-actions[bot] Committed by GitHub
Browse files

Merge staging-next into staging

parents eea46ac5 d8d87352
Loading
Loading
Loading
Loading
+89 −50
Original line number Diff line number Diff line
{ lib, stdenv, fetchurl, cmake, curl, Accelerate, CoreGraphics, CoreVideo
, fftwSinglePrec, netcdf, pcre, gdal, blas, lapack, glibc, ghostscript, dcw-gmt
, gshhg-gmt }:
{
  lib,
  stdenv,
  fetchFromGitHub,
  cmake,
  curl,
  Accelerate,
  CoreGraphics,
  CoreVideo,
  fftwSinglePrec,
  netcdf,
  libxml2,
  pcre,
  gdal,
  blas,
  lapack,
  glibc,
  ghostscript,
  dcw-gmt,
  gshhg-gmt,
}:

/* The onus is on the user to also install:
/*
  The onus is on the user to also install:
   - ffmpeg for webm or mp4 output
   - graphicsmagick for gif output
*/

stdenv.mkDerivation rec {
let
  # Certainly not an ideal situation, See:
  # https://github.com/NixOS/nixpkgs/pull/340707#issuecomment-2361894717
  netcdf' = netcdf.override {
    libxml2 = libxml2.override {
      enableHttp = true;
    };
  };
in stdenv.mkDerivation (finalAttrs: {
  pname = "gmt";
  version = "6.4.0";
  src = fetchurl {
    url = "https://github.com/GenericMappingTools/gmt/releases/download/${version}/gmt-${version}-src.tar.gz";
    sha256 = "sha256-0mfAx9b7MMnqfgKe8n2tsm/9e5LLS0cD+aO6Do85Ohs=";
  version = "6.5.0";
  src = fetchFromGitHub {
    owner = "GenericMappingTools";
    repo = "gmt";
    rev = "refs/tags/${finalAttrs.version}";
    hash = "sha256-KKIYhljCtk9t9CuvTLsSGvUkUwazWTm9ymBB3wLwSoI=";
  };

  nativeBuildInputs = [ cmake ];
  nativeBuildInputs = [
    cmake
  ];

  buildInputs = [ curl gdal netcdf pcre dcw-gmt gshhg-gmt ]
    ++ (if stdenv.hostPlatform.isDarwin then [
  buildInputs =
    [
      curl
      gdal
      netcdf'
      pcre
      dcw-gmt
      gshhg-gmt
    ]
    ++ (
      if stdenv.hostPlatform.isDarwin then
        [
          Accelerate
          CoreGraphics
          CoreVideo
    ] else [
        ]
      else
        [
          glibc
          fftwSinglePrec
          blas
          lapack
    ]);
        ]
    );

  propagatedBuildInputs = [ ghostscript ];
  propagatedBuildInputs = [
    ghostscript
  ];

  cmakeFlags = [
  cmakeFlags =
    [
      "-DGMT_DOCDIR=share/doc/gmt"
      "-DGMT_MANDIR=share/man"
      "-DGMT_LIBDIR=lib"
@@ -39,21 +86,13 @@ stdenv.mkDerivation rec {
      "-DGSHHG_ROOT=${gshhg-gmt.out}/share/gshhg-gmt"
      "-DCOPY_DCW:BOOL=FALSE"
      "-DDCW_ROOT=${dcw-gmt.out}/share/dcw-gmt"
    "-DGDAL_ROOT=${gdal.out}"
    "-DNETCDF_ROOT=${netcdf.out}"
    "-DPCRE_ROOT=${pcre.out}"
      "-DGMT_INSTALL_TRADITIONAL_FOLDERNAMES:BOOL=FALSE"
      "-DGMT_ENABLE_OPENMP:BOOL=TRUE"
      "-DGMT_INSTALL_MODULE_LINKS:BOOL=FALSE"
      "-DLICENSE_RESTRICTED=LGPL" # "GPL" and "no" also valid
  ] ++ (with stdenv;
    lib.optionals (!isDarwin) [
      "-DFFTW3_ROOT=${fftwSinglePrec.dev}"
      "-DLAPACK_LIBRARY=${lapack}/lib/liblapack.so"
      "-DBLAS_LIBRARY=${blas}/lib/libblas.so"
    ]);
    ];

  meta = with lib; {
  meta = {
    homepage = "https://www.generic-mapping-tools.org";
    description = "Tools for manipulating geographic and cartesian data sets";
    longDescription = ''
@@ -65,9 +104,9 @@ stdenv.mkDerivation rec {
      transformations and includes supporting data such as coastlines, rivers,
      and political boundaries and optionally country polygons.
    '';
    platforms = [ "x86_64-linux" "x86_64-darwin" ];
    license = licenses.lgpl3Plus;
    maintainers = with maintainers; [ tviti ];
    platforms = lib.platforms.unix;
    license = lib.licenses.lgpl3Plus;
    maintainers = with lib.maintainers; [ tviti ];
  };

}
})
+27 −30
Original line number Diff line number Diff line
From c4f452ef6ae083ed21095313582f6d1bd775cbf3 Mon Sep 17 00:00:00 2001
From: Andreas Rammhold <andreas@rammhold.de>
Date: Thu, 2 Nov 2023 17:32:07 +0100
Subject: [PATCH] NIXOS: don't ignore PYTHONPATH
commit c534a831c2f7186ebabe4e17f1e1df6d11ebff89
Author: Samuel Rounce <me@samuelrounce.co.uk>
Date:   Thu Sep 5 22:17:21 2024 +0100

    [PATCH] NIXOS: don't ignore PYTHONPATH
    
    On NixOS or rather within nixpkgs we provide the runtime Python
    packages via the PYTHONPATH environment variable. FreeCAD tries its
@@ -16,29 +17,27 @@ shouldn't accept this patch (as is). What they might accept (once
    support for older Python versions has been dropped) is removing the
    PYTHONPATH specific putenv calls.
---
 src/Base/Interpreter.cpp | 2 +-
 src/Base/Interpreter.cpp | 1 +
 src/Main/MainGui.cpp     | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/Base/Interpreter.cpp b/src/Base/Interpreter.cpp
index 52c47168af..9966bd0013 100644
index 2bdc54ccff..ee4f7fc070 100644
--- a/src/Base/Interpreter.cpp
+++ b/src/Base/Interpreter.cpp
@@ -554,7 +554,9 @@ void initInterpreter(int argc,char *argv[])
 {
     PyStatus status;
@@ -593,6 +593,7 @@ void initInterpreter(int argc, char* argv[])
     PyConfig config;
     PyConfig_InitIsolatedConfig(&config);
+    config.isolated = 0;
     config.isolated = 0;
+    config.use_environment = 1;
     config.user_site_directory = 1;
 
     status = PyConfig_SetBytesArgv(&config, argc, argv);
     if (PyStatus_Exception(status)) {
diff --git a/src/Main/MainGui.cpp b/src/Main/MainGui.cpp
index 48ae847ef4..28813df383 100644
index 36087cffd6..89d49d2cc6 100644
--- a/src/Main/MainGui.cpp
+++ b/src/Main/MainGui.cpp
@@ -112,17 +112,14 @@ int main( int argc, char ** argv )
@@ -114,10 +114,8 @@ int main(int argc, char** argv)
     // See https://forum.freecad.org/viewtopic.php?f=18&t=20600
     // See Gui::Application::runApplication()
     putenv("LC_NUMERIC=C");
@@ -49,13 +48,11 @@ index 48ae847ef4..28813df383 100644
 #elif defined(__MINGW32__)
     const char* mingw_prefix = getenv("MINGW_PREFIX");
     const char* py_home = getenv("PYTHONHOME");
     if (!py_home && mingw_prefix)
@@ -125,7 +123,6 @@ int main(int argc, char** argv)
         _putenv_s("PYTHONHOME", mingw_prefix);
     }
 #else
-    _putenv("PYTHONPATH=");
     // https://forum.freecad.org/viewtopic.php?f=4&t=18288
     // https://forum.freecad.org/viewtopic.php?f=3&t=20515
     const char* fc_py_home = getenv("FC_PYTHONHOME");
-- 
2.42.0
+7 −0
Original line number Diff line number Diff line
--- a/src/3rdParty/OndselSolver/OndselSolver.pc.in
+++ b/src/3rdParty/OndselSolver/OndselSolver.pc.in
@@ -3,2 +3,2 @@
-libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
+libdir=@CMAKE_INSTALL_LIBDIR@
+includedir=@CMAKE_INSTALL_INCLUDEDIR@
+15 −5
Original line number Diff line number Diff line
@@ -9,12 +9,12 @@
, gfortran
, gts
, hdf5
, libGLU
, libXmu
, libf2c
, libGLU
, libredwg
, libsForQt5
, libspnav
, libXmu
, medfile
, mpi
, ninja
@@ -29,6 +29,7 @@
, vtk
, wrapGAppsHook3
, xercesc
, yaml-cpp
, zlib
, withWayland ? false
}:
@@ -50,6 +51,7 @@ let
    matplotlib
    pivy
    ply
    pybind11
    pycollada
    pyside2
    pyside2-tools
@@ -61,13 +63,14 @@ let
in
stdenv.mkDerivation (finalAttrs: {
  pname = "freecad";
  version = "0.21.2";
  version = "1.0rc2";

  src = fetchFromGitHub {
    owner = "FreeCAD";
    repo = "FreeCAD";
    rev = finalAttrs.version;
    hash = "sha256-OX4s9rbGsAhH7tLJkUJYyq2A2vCdkq/73iqYo9adogs=";
    hash = "sha256-kPmfx/C1fCYwBqh6ZOKZAVNVR9m3VryPmBKu3ksDD5E=";
    fetchSubmodules = true;
  };

  nativeBuildInputs = [
@@ -100,6 +103,7 @@ stdenv.mkDerivation (finalAttrs: {
      opencascade-occt
      pivy
      ply # for openSCAD file support
      pybind11
      pycollada
      pyside2
      pyside2-tools
@@ -116,6 +120,7 @@ stdenv.mkDerivation (finalAttrs: {
      swig
      vtk
      xercesc
      yaml-cpp
      zlib
    ]
    ++ lib.optionals spaceNavSupport [
@@ -125,12 +130,17 @@ stdenv.mkDerivation (finalAttrs: {

  patches = [
    ./0001-NIXOS-don-t-ignore-PYTHONPATH.patch
    ./0002-FreeCad-OndselSolver-pkgconfig.patch
  ];

  cmakeFlags = [
    "-Wno-dev" # turns off warnings which otherwise makes it hard to see what is going on
    "-DBUILD_FLAT_MESH:BOOL=ON"
    "-DBUILD_QT5=ON"
    "-DBUILD_DRAWING=ON"
    "-DBUILD_FLAT_MESH:BOOL=ON"
    "-DINSTALL_TO_SITEPACKAGES=OFF"
    "-DFREECAD_USE_PYBIND11=ON"
    "-DSHIBOKEN_INCLUDE_DIR=${shiboken2}/include"
    "-DSHIBOKEN_LIBRARY=Shiboken2::libshiboken"
    (
@@ -201,7 +211,7 @@ stdenv.mkDerivation (finalAttrs: {
      right at home with FreeCAD.
    '';
    license = lib.licenses.lgpl2Plus;
    maintainers = with lib.maintainers; [ gebner AndersonTorres ];
    maintainers = with lib.maintainers; [ gebner AndersonTorres srounce ];
    platforms = lib.platforms.linux;
  };
})
+36 −0
Original line number Diff line number Diff line
{
  lib,
  buildGoModule,
  fetchFromGitLab,
  fetchpatch2,
}:

buildGoModule rec {
  pname = "golex";
  version = "1.1.0";

  src = fetchFromGitLab {
    owner = "cznic";
    repo = "golex";
    rev = "v${version}";
    hash = "sha256-0Z2oE00vGnH2BBNmKAjRhy//fEbT5AQ+CKLIUr+NPwY=";
  };

  patches = [
    # fix a unicode mismatch to make test pass
    (fetchpatch2 {
      url = "https://gitlab.com/cznic/golex/-/commit/a735a3b62b5fb36a715ba4e280270f9ca91c5e59.patch";
      hash = "sha256-Q/Vyh91IwL3ConWpJU0akslkaVhHTkBmrMbmDVU3Txs=";
    })
  ];

  vendorHash = "sha256-Ig4cxZepvmI1EH0j2fuQ33jHOLWfS40UE+A4UHdo8oE=";

  meta = {
    description = "Lex/flex like utility rendering .l formated data to Go source code";
    homepage = "https://pkg.go.dev/modernc.org/golex";
    license = lib.licenses.bsd3;
    mainProgram = "golex";
    maintainers = with lib.maintainers; [ aleksana ];
  };
}
Loading