From patchwork Wed Aug 31 18:51:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kristian Lein-Mathisen X-Patchwork-Id: 42100 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9D99C27BBE9; Wed, 31 Aug 2022 21:41:24 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8B6FE27BBEA for ; Wed, 31 Aug 2022 21:41:23 +0100 (BST) Received: from localhost ([::1]:40156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTUWY-0004WE-Na for patchwork@mira.cbaines.net; Wed, 31 Aug 2022 16:41:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57264) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTTuV-0003ox-0U for guix-patches@gnu.org; Wed, 31 Aug 2022 16:02:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50800) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oTTuU-0001Un-Lt for guix-patches@gnu.org; Wed, 31 Aug 2022 16:02:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oTTuU-0006vP-Gv for guix-patches@gnu.org; Wed, 31 Aug 2022 16:02:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57361] Solvespace package re-done References: In-Reply-To: Resent-From: Kristian Lein-Mathisen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 31 Aug 2022 20:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57361 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57361@debbugs.gnu.org Received: via spool by 57361-submit@debbugs.gnu.org id=B57361.166197607126561 (code B ref 57361); Wed, 31 Aug 2022 20:02:02 +0000 Received: (at 57361) by debbugs.gnu.org; 31 Aug 2022 20:01:11 +0000 Received: from localhost ([127.0.0.1]:40549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTTtd-0006uJ-Kd for submit@debbugs.gnu.org; Wed, 31 Aug 2022 16:01:11 -0400 Received: from mail-oa1-f51.google.com ([209.85.160.51]:43801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oTSoi-000566-3E for 57361@debbugs.gnu.org; Wed, 31 Aug 2022 14:52:06 -0400 Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-11eb44f520dso22007496fac.10 for <57361@debbugs.gnu.org>; Wed, 31 Aug 2022 11:52:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=b6QofAL2o/0VrRdnqSnHnabzE58sXmJj2/fEovWWrJ4=; b=HqC0edFzJEmyFdWQ1SZORwn2yi4tM3s2Q3l4XukGJQQol7vlkHlhKMlrvjwrmOVdiC fSYpFN4BvunPQwFnGIQpmLgW1jmoaIG4Ki4mBPV7+a/QWIPkdPHS2D5w3NdMYeF7fB91 Q/yOE+8970DmycvzIPZhNinfz2gd0KzDRRSxbEYsknuM+pRvpqXoRhwx+uzJFbmCq3GE U3J9bu5uwV8fDFT4ZFd0vR+EHAfdCepqt4kfizIp4owtezI3N4RoNMHcH5OLeo6L2sz/ PHC/qJ/w3caIUMunuTFLjHJkPk7FAbDDH5hlDHuyHHxTIfUos+3AwSM95GCYaboISzES 9HEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=b6QofAL2o/0VrRdnqSnHnabzE58sXmJj2/fEovWWrJ4=; b=o4INrQg5qJGzpy0V2Bs2SD1iMHu2nDLRWEj14KTHqEkxHaGayeDJahOhZ4Z5zc8Lmf zah4YDEny1BemntMoo/YG4OmI/FOAmJJ/kJowi6qW2vCAgL6Eq0QvIEDZicVihyVlOLw uHfyOcV44mt+Zfpkor8+e5eeJDephPLL52RlY1iD4yFjI2bwa0IBHJWUhXah664EkW0o bnl3olCvEmmzsf/KZFOznnPRzz1zB+427C9gupBXdhtmAqRLTzmrzltpcAvw/uYRNYJ0 cGJn449AKOLwPSKiPdXHEAh9rIMCaYCI66BoEGc5R/uVGFOb5jPPB2axOe3DBPVFMzgz 6Pgw== X-Gm-Message-State: ACgBeo0u+aF9Gvf3ZzjZvKyj1R41wwA1kB5AYISAiOx1903yVltLT/0D YiA93phtPcDlEEkMj8d4lzIx1xgqL3gJYkwvj7n7betbG80= X-Google-Smtp-Source: AA6agR7Wm+iNzuHtgJ6WJKNcgSYZL2g63u90i8NdJy8XzKJwq5bEFfj0/r5VTCqvvDlNwXY1QLpN8eB87GhIyMTQDtI= X-Received: by 2002:a05:6808:1a26:b0:344:843c:5244 with SMTP id bk38-20020a0568081a2600b00344843c5244mr1706975oib.74.1661971914396; Wed, 31 Aug 2022 11:51:54 -0700 (PDT) MIME-Version: 1.0 From: Kristian Lein-Mathisen Date: Wed, 31 Aug 2022 20:51:43 +0200 Message-ID: X-Mailman-Approved-At: Wed, 31 Aug 2022 16:01:07 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Wed, 31 Aug 2022 16:40:18 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Based off feedback from lilyp and rekado_ on #guix, I've made some improvements: - Remove the recursive checkout - Extract mimalloc as a (nonpublic) package - Fix commit hash value - Enabled tests I've made an amend commit, so the new patch replaces the original one above. Note that the previous commit hash of solvespace of was off. The correct hash for solvespace 3.1 is 70bde63cb32a7f049fa56cbdf924e2695fcb2916, as shown in the new patch. Thanks for all help this far, and hoping to see SolveSpace included in GNU Guix. - Kris From 29879ec9bd80f4f24a391b2222efc20a6ab2139a Mon Sep 17 00:00:00 2001 From: Kristian Lein-Mathisen Date: Tue, 23 Aug 2022 12:45:49 +0200 Subject: [PATCH] gnu: Add solvespace. * gnu/packages/engineering.scm (solvespace): New variable. --- gnu/packages/engineering.scm | 120 +++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index f195179413..68d0e55242 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -2895,6 +2895,126 @@ (define-public pcb2gcode dynamic calibration of the milling depth.") (license license:gpl3+)))) +;; There is another mimalloc, used in rust-mimalloc. But it's on mimalloc +;; version 1.6.4. TODO: See if it's possible to re-use this package by both. +(define mimalloc-for-solvespace + (let ((commit "f2712f4a8f038a7fb4df2790f4c3b7e3ed9e219b") + (version "2.0.6")) + (package + (name "mimalloc-for-solvespace") + (version (git-version version "1" commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/microsoft/mimalloc") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "05x2dl3zimflfj91ns3vrphmzpdlyyr230p9adqgfds101f16qmv")))) + (build-system cmake-build-system) + (arguments + `(#:build-type "Release")) + (synopsis "Compact general purpose allocator with excellent performance") + (description "@code{mimalloc} is a drop-in replacement for @code{malloc} +and can be used in other programs without code changes, for example, on dynamically +linked ELF-based systems (Linux, BSD, etc.) you can use it as: + +LD_PRELOAD=/usr/lib/libmimalloc.so myprogram + +Initially developed by Daan Leijen for the run-time systems of the Koka and +Lean languages.") + (home-page "https://microsoft.github.io/mimalloc/") + (license license:expat)))) + + +(define-public solvespace + (let ((commit "70bde63cb32a7f049fa56cbdf924e2695fcb2916") + (version "3.1") + ;; libdxfrw has no readme, no version release, no tags. Initial + ;; commit says "libdxfrw-0.6.3 import", but it shares no git history + ;; with "upstream" https://github.com/codelibs/libdxfrw. Both are + ;; difficult to package separately as they don't install properly. + ;; Copying in-tree instead of #:recursive #t to avoid downloading the + ;; other bigger dependencies which aren't needed. + (libdxfrw-sources (origin + (method git-fetch) + (uri (git-reference (url + "https://github.com/solvespace/libdxfrw") + (commit + "0b7b7b709d9299565db603f878214656ef5e9ddf"))) + (sha256 (base32 + "0d2wjq81466m3hb5cffiy99vhx0irwwy47yfxp318k2q4cvd5z2a"))))) + (package + (name "solvespace") + (version (git-version version "1" commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/solvespace/solvespace") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1hbdln44k00a6vlklv2mq2c9zda3i9d5x0f7ks85w4v6zskhqnra")))) + (build-system cmake-build-system) + (native-inputs (list pkg-config gettext-minimal)) + (arguments + (list #:build-type "Release" + #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'unpack-libdxfrw + (lambda _ + (copy-recursively #$libdxfrw-sources + "extlib/libdxfrw"))) + (add-before 'configure 'embed-git-commit-hash + (lambda _ + ;; `git describe` doesn't work here, so embed + ;; the commit hash directly in CMakeLists.txt as + ;; described instead. + (substitute* "CMakeLists.txt" + (("include\\(GetGitCommitHash\\)") + (string-append "set(GIT_COMMIT_HASH " + #$commit ")"))))) + (add-before 'configure 'use-packaged-mimalloc + (lambda _ + (substitute* "CMakeLists.txt" + (("message\\(STATUS \"Using in-tree mimalloc\"\\)") + "message(STATUS \"Using guix packaged mimalloc\")") + (("add_subdirectory\\(extlib/mimalloc EXCLUDE_FROM_ALL\\)") + "find_package(mimalloc REQUIRED)"))))))) + (inputs (list cairo + eigen + freetype + gtkmm-3 + json-c + libpng + libspnav ;spaceware + mimalloc-for-solvespace + mesa + zlib)) + (synopsis "Parametric 2D/3D CAD") + (description + "SOLVESPACE is a parametric 3D @acronym{CAD, +Computer Aided Design} tool. Applications include: + +@itemize +@item modeling 3d parts — draw with extrudes, revolves, helixes and + Boolean (union / difference / intersection) operations +@item modeling 2d parts — draw the part as a single section, + and export DXF, PDF, SVG; use 3d assembly to verify fit +@item 3d-printed parts — export the STL or other triangle mesh + expected by most 3d printers +@item preparing CAM data — export 2d vector art for a waterjet + machine or laser cutter; or generate STEP or STL, for import into + third-party CAM software for machining +@item mechanism design — use the constraint solver to simulate planar + or spatial linkages, with pin, ball, or slide joints +@item plane and solid geometry — replace hand-solved trigonometry and spreadsheets + with a live dimensioned drawing +@end itemize") + (home-page "https://solvespace.com/") + (license license:gpl3+)))) + (define-public syscall-intercept ;; Upstream provides no tag. Also, last version update is 4 years old. (let ((commit "304404581c57d43478438d175099d20260bae74e") base-commit: 7c47fa25134a2111e596e96198d02644aedae459 -- 2.37.2