From 49b5e7e93c0295f5edbac93ed5f5a904f9842ad6 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 31 Mar 2023 16:21:38 -0400 Subject: [PATCH] gnu: openboardview: Update to 9.95.0. * gnu/packages/electronics.scm (openboardview): Update to 9.95.0. [source]: Apply patch. [arguments]: Update fix-utf8-include-directive phase. [inputs]: Add orangeduck-mpc. * gnu/packages/patches/openboardview-use-system-mpc.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. --- gnu/local.mk | 1 + gnu/packages/electronics.scm | 11 +++-- .../openboardview-use-system-mpc.patch | 42 +++++++++++++++++++ 3 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 gnu/packages/patches/openboardview-use-system-mpc.patch diff --git a/gnu/local.mk b/gnu/local.mk index 3c188cf1f7..436b6b9e81 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1618,6 +1618,7 @@ dist_patch_DATA = \ %D%/packages/patches/onnx-skip-model-downloads.patch \ %D%/packages/patches/openbios-aarch64-riscv64-support.patch \ %D%/packages/patches/openboardview-use-system-imgui.patch \ + %D%/packages/patches/openboardview-use-system-mpc.patch \ %D%/packages/patches/openbox-python3.patch \ %D%/packages/patches/openfoam-4.1-cleanup.patch \ %D%/packages/patches/openjdk-10-idlj-reproducibility.patch \ diff --git a/gnu/packages/electronics.scm b/gnu/packages/electronics.scm index 4d7f4d2e05..5ab9662551 100644 --- a/gnu/packages/electronics.scm +++ b/gnu/packages/electronics.scm @@ -4,7 +4,7 @@ ;;; Copyright © 2019 Clément Lassieur ;;; Copyright © 2021 Efraim Flashner ;;; Copyright © 2021 Leo Famulari -;;; Copyright © 2022 Maxim Cournoyer +;;; Copyright © 2022, 2023 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -252,7 +252,7 @@ (define-public sigrok-cli (define-public openboardview (package (name "openboardview") - (version "9.0.3") + (version "9.95.0") (source (origin (method git-fetch) (uri (git-reference @@ -270,10 +270,11 @@ (define keep (list "." ".." "openboardview")) (delete-file-recursively f))) (scandir "." (negate (cut member <> keep)))))) (patches - (search-patches "openboardview-use-system-imgui.patch")) + (search-patches "openboardview-use-system-imgui.patch" + "openboardview-use-system-mpc.patch")) (sha256 (base32 - "0wmplzgi3rpkcajdrnkxvqhgxrn6qdxa6vwgd24bm10ryyhiqw54")))) + "1safjd729a7591rigkiy3c678bivrj5q1qwg1f18sijhlsfkf5b3")))) (build-system cmake-build-system) (arguments (list @@ -302,6 +303,7 @@ (define keep (list "." ".." "openboardview")) ;; directly rather than "utf8/utf8.h". (lambda _ (substitute* '("src/openboardview/FileFormats/BRDFile.cpp" + "src/openboardview/FileFormats/BRDFileBase.cpp" "src/openboardview/BoardView.cpp") (("utf8/utf8.h") "utf8.h")))) (add-before 'configure 'dynamically-load-gtk-via-absolute-path @@ -327,6 +329,7 @@ (define keep (list "." ".." "openboardview")) (list fontconfig gtk+ imgui + orangeduck-mpc sdl2 sqlite zlib)) diff --git a/gnu/packages/patches/openboardview-use-system-mpc.patch b/gnu/packages/patches/openboardview-use-system-mpc.patch new file mode 100644 index 0000000000..7726c55fe8 --- /dev/null +++ b/gnu/packages/patches/openboardview-use-system-mpc.patch @@ -0,0 +1,42 @@ +Upstream status: https://github.com/OpenBoardView/OpenBoardView/pull/281 + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 452dfa9..e30c3cf 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -206,13 +206,15 @@ endif() + add_definitions(-DSTBI_FAILURE_USERMSG) + + ## mpc - Micro Parser Combinators ## +-execute_process( +- COMMAND git submodule update --init src/mpc +- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} +-) +- +-add_library(mpc STATIC "mpc/mpc.c") +- ++pkg_check_modules(MPC QUIET mpc) ++if(NOT MPC_FOUND) ++ execute_process( ++ COMMAND git submodule update --init src/mpc ++ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} ++ ) ++ add_library(mpc STATIC "mpc/mpc.c") ++ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/mpc) ++endif() + + ## OpenBoardView ## + add_subdirectory(openboardview) +diff --git a/src/openboardview/FileFormats/GenCADFile.h b/src/openboardview/FileFormats/GenCADFile.h +index 1ccf8df..c57f7ff 100644 +--- a/src/openboardview/FileFormats/GenCADFile.h ++++ b/src/openboardview/FileFormats/GenCADFile.h +@@ -5,7 +5,7 @@ + + #include "build-generated/GenCADFileGrammar.h" + +-#include "mpc/mpc.h" ++#include "mpc.h" + + #include + #include