diff options
| author | Marek Roszko <mark.roszko@gmail.com> | 2021-02-02 17:28:38 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-02 14:28:38 -0800 |
| commit | 1ce08c0fc7d5b59e50b51c01ef8731ce1880ffc8 (patch) | |
| tree | 7d806ecac64d043633dc2889c9670089906366c4 | |
| parent | bbb50a7d8b009a6911c598058f0248cd8d752fbb (diff) | |
| download | vcpkg-1ce08c0fc7d5b59e50b51c01ef8731ce1880ffc8.tar.gz vcpkg-1ce08c0fc7d5b59e50b51c01ef8731ce1880ffc8.zip | |
[ngspice] build codemodel extension libraries (#15882)
* [ngspice] build codemodel extension libraries
* tabs -> spaces
* [ngspice] make codemodels a feature
* [ngspice] Improve portfile.cmake
* update version record
Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
| -rw-r--r-- | ports/ngspice/CONTROL | 5 | ||||
| -rw-r--r-- | ports/ngspice/portfile.cmake | 68 | ||||
| -rw-r--r-- | ports/ngspice/use-winbison-sharedspice.patch (renamed from ports/ngspice/use-winbison-global.patch) | 0 | ||||
| -rw-r--r-- | ports/ngspice/use-winbison-vngspice.patch | 50 | ||||
| -rw-r--r-- | versions/baseline.json | 2 | ||||
| -rw-r--r-- | versions/n-/ngspice.json | 5 |
6 files changed, 109 insertions, 21 deletions
diff --git a/ports/ngspice/CONTROL b/ports/ngspice/CONTROL index 52d04f3aa..c11036c4b 100644 --- a/ports/ngspice/CONTROL +++ b/ports/ngspice/CONTROL @@ -1,5 +1,10 @@ Source: ngspice Version: 33 +Port-Version: 1 Homepage: http://ngspice.sourceforge.net/ Description: Ngspice is a mixed-level/mixed-signal electronic circuit simulator. It is a successor of the latest stable release of Berkeley SPICE Supports: !(linux|osx|arm|uwp) +Default-Features: codemodels + +Feature: codemodels +Description: Adds optional code models for XSPICE, ADMS (verilog integration) and B-/E-/G- sources. diff --git a/ports/ngspice/portfile.cmake b/ports/ngspice/portfile.cmake index 538a02f5e..1c85e1133 100644 --- a/ports/ngspice/portfile.cmake +++ b/ports/ngspice/portfile.cmake @@ -12,7 +12,8 @@ vcpkg_from_sourceforge( FILENAME "ngspice-33.tar.gz"
SHA512 895e39f7de185df18bf443a9fa5691cdb3bf0a5091d9860d20ccb02254ef396a4cca5a1c8bf4ba19a03783fc89bb86649218cee977b0fe4565d3c84548943c09
PATCHES
- use-winbison-global.patch
+ use-winbison-sharedspice.patch
+ use-winbison-vngspice.patch
)
vcpkg_find_acquire_program(BISON)
@@ -20,33 +21,60 @@ vcpkg_find_acquire_program(BISON) get_filename_component(BISON_DIR "${BISON}" DIRECTORY)
vcpkg_add_to_path(PREPEND "${BISON_DIR}")
-# Ensure its windows
-if (VCPKG_TARGET_IS_WINDOWS)
- # Sadly, vcpkg globs .libs inside install_msbuild and whines that the 47 year old SPICE format isn't a MSVC lib ;)
- # We need to kill them off first before the source tree is copied to a tmp location by install_msbuild
+# Sadly, vcpkg globs .libs inside install_msbuild and whines that the 47 year old SPICE format isn't a MSVC lib ;)
+# We need to kill them off first before the source tree is copied to a tmp location by install_msbuild
- file(REMOVE_RECURSE ${SOURCE_PATH}/contrib)
- file(REMOVE_RECURSE ${SOURCE_PATH}/examples)
- file(REMOVE_RECURSE ${SOURCE_PATH}/man)
- file(REMOVE_RECURSE ${SOURCE_PATH}/tests)
+file(REMOVE_RECURSE ${SOURCE_PATH}/contrib)
+file(REMOVE_RECURSE ${SOURCE_PATH}/examples)
+file(REMOVE_RECURSE ${SOURCE_PATH}/man)
+file(REMOVE_RECURSE ${SOURCE_PATH}/tests)
- vcpkg_install_msbuild(
- SOURCE_PATH ${SOURCE_PATH}
+# this builds the main dll
+vcpkg_install_msbuild(
+ SOURCE_PATH ${SOURCE_PATH}
+ INCLUDES_SUBPATH /src/include
+ LICENSE_SUBPATH COPYING
+ # install_msbuild swaps x86 for win32(bad) if we dont force our own setting
+ PLATFORM ${TRIPLET_SYSTEM_ARCH}
+ PROJECT_SUBPATH visualc/sharedspice.sln
+ TARGET Build
+)
+
+if("codemodels" IN_LIST FEATURES)
+ # vngspice generates "codemodels" to enhance simulation capabilities
+ # we cannot use install_msbuild as they output with ".cm" extensions on purpose
+ set(BUILDTREE_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET})
+ file(REMOVE_RECURSE ${BUILDTREE_PATH})
+ file(COPY ${SOURCE_PATH}/ DESTINATION ${BUILDTREE_PATH})
+
+ vcpkg_build_msbuild(
+ PROJECT_PATH ${BUILDTREE_PATH}/visualc/vngspice.sln
INCLUDES_SUBPATH /src/include
LICENSE_SUBPATH COPYING
- # install_msbuild swaps x86 for win32(bad) if we dont force our own setting
+ # build_msbuild swaps x86 for win32(bad) if we dont force our own setting
PLATFORM ${TRIPLET_SYSTEM_ARCH}
- PROJECT_SUBPATH visualc/sharedspice.sln
TARGET Build
)
-else()
- message(FATAL_ERROR "Sorry but ngspice only can be built in Windows")
+
+ #put the code models in the intended location
+ file(GLOB NGSPICE_CODEMODELS_DEBUG
+ ${BUILDTREE_PATH}/visualc/codemodels/${TRIPLET_SYSTEM_ARCH}/Debug/*.cm
+ )
+ file(COPY ${NGSPICE_CODEMODELS_DEBUG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/ngspice)
+
+ file(GLOB NGSPICE_CODEMODELS_RELEASE
+ ${BUILDTREE_PATH}/visualc/codemodels/${TRIPLET_SYSTEM_ARCH}/Release/*.cm
+ )
+ file(COPY ${NGSPICE_CODEMODELS_RELEASE} DESTINATION ${CURRENT_PACKAGES_DIR}/lib/ngspice)
+
+
+ # copy over spinit (spice init)
+ file(RENAME ${BUILDTREE_PATH}/visualc/spinit_all ${BUILDTREE_PATH}/visualc/spinit)
+ file(COPY ${BUILDTREE_PATH}/visualc/spinit DESTINATION ${CURRENT_PACKAGES_DIR}/share/ngspice)
endif()
+vcpkg_copy_pdbs()
+
# Unforunately install_msbuild isn't able to dual include directories that effectively layer
-file(GLOB NGSPICE_INCLUDES
- ${SOURCE_PATH}/visualc/src/include/ngspice/*
-)
+file(GLOB NGSPICE_INCLUDES ${SOURCE_PATH}/visualc/src/include/ngspice/*)
file(COPY ${NGSPICE_INCLUDES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/ngspice)
-
-vcpkg_copy_pdbs()
diff --git a/ports/ngspice/use-winbison-global.patch b/ports/ngspice/use-winbison-sharedspice.patch index c345e9839..c345e9839 100644 --- a/ports/ngspice/use-winbison-global.patch +++ b/ports/ngspice/use-winbison-sharedspice.patch diff --git a/ports/ngspice/use-winbison-vngspice.patch b/ports/ngspice/use-winbison-vngspice.patch new file mode 100644 index 000000000..008bc686d --- /dev/null +++ b/ports/ngspice/use-winbison-vngspice.patch @@ -0,0 +1,50 @@ +diff --git a/visualc/vngspice.vcxproj b/visualc/vngspice.vcxproj
+index 2d1aa81..cf0f0c7 100644
+--- a/visualc/vngspice.vcxproj
++++ b/visualc/vngspice.vcxproj
+@@ -2681,12 +2681,12 @@
+ <ItemGroup>
+ <CustomBuild Include="..\src\frontend\parse-bison.y">
+ <Message>invoke win_bison.exe for %(Identity)</Message>
+- <Command>..\..\flex-bison\win_bison.exe --output=.\tmp-bison\%(Filename).c --defines=.\tmp-bison\%(Filename).h %(Identity) || exit 1</Command>
++ <Command>win_bison.exe --output=.\tmp-bison\%(Filename).c --defines=.\tmp-bison\%(Filename).h %(Identity) || exit 1</Command>
+ <Outputs>.\tmp-bison\%(Filename).c;.\tmp-bison\%(Filename).h</Outputs>
+ </CustomBuild>
+ <CustomBuild Include="..\src\spicelib\parser\inpptree-parser.y">
+ <Message>invoke win_bison.exe for %(Identity)</Message>
+- <Command>..\..\flex-bison\win_bison.exe --output=.\tmp-bison\%(Filename).c --defines=.\tmp-bison\%(Filename).h %(Identity) || exit 1</Command>
++ <Command>win_bison.exe --output=.\tmp-bison\%(Filename).c --defines=.\tmp-bison\%(Filename).h %(Identity) || exit 1</Command>
+ <Outputs>.\tmp-bison\%(Filename).c;.\tmp-bison\%(Filename).h</Outputs>
+ </CustomBuild>
+ </ItemGroup>
+diff --git a/visualc/xspice/cmpp/cmpp.vcxproj b/visualc/xspice/cmpp/cmpp.vcxproj
+index 78607a3..7bcc1a4 100644
+--- a/visualc/xspice/cmpp/cmpp.vcxproj
++++ b/visualc/xspice/cmpp/cmpp.vcxproj
+@@ -157,22 +157,22 @@
+ <ItemGroup>
+ <CustomBuild Include="..\..\..\src\xspice\cmpp\ifs_lex.l">
+ <Message>invoke win_flex.exe for %(Identity)</Message>
+- <Command>..\..\..\..\flex-bison\win_flex.exe --outfile=.\tmp-bison\%(Filename).c --header-file=.\tmp-bison\%(Filename).h %(Identity) || exit 1</Command>
++ <Command>win_flex.exe --outfile=.\tmp-bison\%(Filename).c --header-file=.\tmp-bison\%(Filename).h %(Identity) || exit 1</Command>
+ <Outputs>.\tmp-bison\%(Filename).c;.\tmp-bison\%(Filename).h</Outputs>
+ </CustomBuild>
+ <CustomBuild Include="..\..\..\src\xspice\cmpp\ifs_yacc.y">
+ <Message>invoke win_bison.exe for %(Identity)</Message>
+- <Command>..\..\..\..\flex-bison\win_bison.exe --output=.\tmp-bison\%(Filename).c --defines=.\tmp-bison\%(Filename).h %(Identity) || exit 1</Command>
++ <Command>win_bison.exe --output=.\tmp-bison\%(Filename).c --defines=.\tmp-bison\%(Filename).h %(Identity) || exit 1</Command>
+ <Outputs>.\tmp-bison\%(Filename).c;.\tmp-bison\%(Filename).h</Outputs>
+ </CustomBuild>
+ <CustomBuild Include="..\..\..\src\xspice\cmpp\mod_lex.l">
+ <Message>invoke win_flex.exe for %(Identity)</Message>
+- <Command>..\..\..\..\flex-bison\win_flex.exe --outfile=.\tmp-bison\%(Filename).c --header-file=.\tmp-bison\%(Filename).h %(Identity) || exit 1</Command>
++ <Command>win_flex.exe --outfile=.\tmp-bison\%(Filename).c --header-file=.\tmp-bison\%(Filename).h %(Identity) || exit 1</Command>
+ <Outputs>.\tmp-bison\%(Filename).c;.\tmp-bison\%(Filename).h</Outputs>
+ </CustomBuild>
+ <CustomBuild Include="..\..\..\src\xspice\cmpp\mod_yacc.y">
+ <Message>invoke win_bison.exe for %(Identity)</Message>
+- <Command>..\..\..\..\flex-bison\win_bison.exe --output=.\tmp-bison\%(Filename).c --defines=.\tmp-bison\%(Filename).h %(Identity) || exit 1</Command>
++ <Command>win_bison.exe --output=.\tmp-bison\%(Filename).c --defines=.\tmp-bison\%(Filename).h %(Identity) || exit 1</Command>
+ <Outputs>.\tmp-bison\%(Filename).c;.\tmp-bison\%(Filename).h</Outputs>
+ </CustomBuild>
+ <None Include="..\src\xspice\icm\objects.inc" />
diff --git a/versions/baseline.json b/versions/baseline.json index 3832e0b3a..5445b0e9a 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4022,7 +4022,7 @@ }, "ngspice": { "baseline": "33", - "port-version": 0 + "port-version": 1 }, "nifticlib": { "baseline": "2020-04-30", diff --git a/versions/n-/ngspice.json b/versions/n-/ngspice.json index b34cb7d92..6e2f4a819 100644 --- a/versions/n-/ngspice.json +++ b/versions/n-/ngspice.json @@ -1,6 +1,11 @@ { "versions": [ { + "git-tree": "ff27e9605199ca4134c1ab3fa6bcb311096a0e10", + "version-string": "33", + "port-version": 1 + }, + { "git-tree": "90c388f47ca769fd11449fde9d70402e9865a986", "version-string": "33", "port-version": 0 |
