Skip to content

Commit c8cc9a7

Browse files
authored
Merge pull request #268 from proppy/klayout
misc: add klayout
2 parents c7b61c5 + 81f3bed commit c8cc9a7

File tree

4 files changed

+167
-0
lines changed

4 files changed

+167
-0
lines changed

.github/workflows/Build.yml

+11
Original file line numberDiff line numberDiff line change
@@ -740,3 +740,14 @@ jobs:
740740
steps:
741741
- uses: actions/checkout@v3
742742
- uses: ./ci
743+
744+
#66
745+
klayout-linux-py37:
746+
runs-on: "ubuntu-20.04"
747+
env:
748+
PACKAGE: "misc/klayout"
749+
OS_NAME: "linux"
750+
PYTHON_VERSION: "3.7"
751+
steps:
752+
- uses: actions/checkout@v3
753+
- uses: ./ci

misc/klayout/build.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
# Identify OS
7+
UNAME_OUT="$(uname -s)"
8+
case "${UNAME_OUT}" in
9+
Linux*) OS=Linux;;
10+
*) OS="${UNAME_OUT}"
11+
echo "Unknown OS: ${OS}"
12+
exit;;
13+
esac
14+
15+
cd ${SRC_DIR}
16+
./build.sh -build "${SRC_DIR}/build" -python "${PYTHON}" -expert -without-qtbinding -libpng -libexpat -dry-run
17+
18+
cd ${SRC_DIR}/build
19+
make V=1 -j$CPU_COUNT
20+
make V=1 install
21+
22+
cd ${SRC_DIR}/bin-release
23+
cp -a klayout strm* ${PREFIX}/bin/
24+
cp -a *.so* ${PREFIX}/lib/
25+
mkdir -p ${PREFIX}/lib/klayout/
26+
cp -ar pymod *_plugins ${PREFIX}/lib/klayout/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
diff --git a/build.sh b/build.sh
2+
index e49c132e5..a035474bc 100755
3+
--- a/build.sh
4+
+++ b/build.sh
5+
@@ -412,35 +412,8 @@ if [ "$PYTHON" != "" ] && [ "$PYTHON" != "-" ]; then
6+
7+
# Get Python installation files
8+
if [ "$PYTHONLIBFILE" = "" ]; then
9+
- PYTHONLIBFILENAME=`$PYTHON -c "import sysconfig; print(sysconfig.get_config_vars('LDLIBRARY')[0])" 2>/dev/null`
10+
- if [ "$PYTHONLIBFILENAME" = "" ]; then
11+
- PYTHONLIBFILENAME=`$PYTHON -c "import sysconfig; print(sysconfig.get_config_vars('LIBRARY')[0])" 2>/dev/null`
12+
- fi
13+
- if [ "$PYTHONLIBFILENAME" = "" ]; then
14+
- PYTHONLIBFILENAME=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_vars('LDLIBRARY')[0])" 2>/dev/null`
15+
- fi
16+
- if [ "$PYTHONLIBFILENAME" = "" ]; then
17+
- PYTHONLIBFILENAME=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_vars('LIBRARY')[0])" 2>/dev/null`
18+
- fi
19+
- if [ "$PYTHONLIBFILENAME" = "" ]; then
20+
- echo "*** WARNING: Could not get Python library name"
21+
- else
22+
- PYTHONLIBFILEPATH=`$PYTHON -c "import sysconfig; print(sysconfig.get_config_vars('LIBDIR')[0])" 2>/dev/null`
23+
- if [ "$PYTHONLIBFILEPATH" = "" ]; then
24+
- PYTHONLIBFILEPATH=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_vars('LIBDIR')[0])" 2>/dev/null`
25+
- fi
26+
- if [ "$PYTHONLIBFILEPATH" = "" ]; then
27+
- echo "*** WARNING: Could not get Python library path"
28+
- else
29+
- PYTHONLIBFILE="$PYTHONLIBFILEPATH/$PYTHONLIBFILENAME"
30+
- if [ ! -f "$PYTHONLIBFILE" ]; then
31+
- echo " INFO: Python library not in default path, trying to use MULTIARCH"
32+
- PYTHONMULTIARCH=`$PYTHON -c "import sysconfig; print(sysconfig.get_config_vars('MULTIARCH')[0])" 2>/dev/null`
33+
- PYTHONLIBFILE="$PYTHONLIBFILEPATH/$PYTHONMULTIARCH/$PYTHONLIBFILENAME"
34+
- fi
35+
- echo " Python library found: $PYTHONLIBFILE"
36+
- fi
37+
- fi
38+
+ PYTHONLIBFILE=-lpython`$PYTHON -c "import sysconfig; print(sysconfig.get_config_vars('LDVERSION')[0])" 2>/dev/null`
39+
+ echo " Python library found: $PYTHONLIBFILE"
40+
fi
41+
42+
if [ "$PYTHONINCLUDE" = "" ]; then
43+
@@ -537,8 +510,8 @@ if [ "$PYTHONINCLUDE" != "" ]; then
44+
echo "*** ERROR: wrong -pyinc path: $PYTHONINCLUDE/Python does not exist or is not a file"
45+
exit 1
46+
fi
47+
- if [ ! -f "$PYTHONLIBFILE" ]; then
48+
- echo "*** ERROR: wrong -pylib path: $PYTHONLIBFILE does not exist or not a file"
49+
+ if [[ ! ${PYTHONLIBFILE} == -lpython3* ]]; then
50+
+ echo "*** ERROR: wrong -pylib path: $PYTHONLIBFILE does not look like a python library name"
51+
exit 1
52+
fi
53+
else

misc/klayout/meta.yaml

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Use `conda-build-prepare` before building for a better version string.
2+
{% set version = '%s_%04i_%s'|format(GIT_DESCRIBE_TAG, GIT_DESCRIBE_NUMBER|int, GIT_DESCRIBE_HASH or 'gUNKNOWN') %}
3+
4+
{% set python_version = PYTHON_VERSION | default('3.7') %}
5+
{% set py_suffix = 'py%s'|format(python_version|replace('.', '')) %}
6+
7+
package:
8+
name: klayout
9+
version: {{ version }}
10+
11+
source:
12+
git_url: https://github.com/KLayout/klayout.git
13+
git_rev: master
14+
patches:
15+
- force-python-dynamic-link.patch
16+
17+
build:
18+
# number: 201803050325
19+
number: {{ environ.get('DATE_NUM') }}
20+
# string: 20180305_0325_py37
21+
string: {{ environ.get('DATE_STR') }}_{{ py_suffix }}
22+
script_env:
23+
- CI
24+
- CONDA_OUT
25+
- TEST_PACKAGE
26+
27+
requirements:
28+
build:
29+
- make
30+
- {{ compiler('cxx') }}
31+
- {{ cdt('mesa-libgl-devel') }} # [linux]
32+
- {{ cdt('mesa-dri-drivers') }} # [linux]
33+
- {{ cdt('libselinux') }} # [linux]
34+
- {{ cdt('libxdamage') }} # [linux]
35+
- {{ cdt('libxxf86vm') }} # [linux]
36+
- {{ cdt('libxext') }} # [linux]
37+
- {{ cdt('libxfixes') }} # [linux]
38+
- {{ cdt('libxau') }} # [linux]
39+
- {{ cdt('libxcb') }} # [linux]
40+
- {{ cdt('expat') }} # [linux]
41+
- {{ cdt('libpng') }} # [linux]
42+
host:
43+
- python {{ python_version }}
44+
- ruby
45+
- qt
46+
- zlib
47+
run:
48+
- python {{ python_version }}
49+
- ruby
50+
- qt
51+
- zlib
52+
53+
test:
54+
commands:
55+
- klayout -v
56+
57+
about:
58+
home: https://www.klayout.de/
59+
summary: 'Your Mask Layout Friend'
60+
description: |
61+
- View: Fast and accurate viewing of huge layout files
62+
- Edit: Draw, modify and transform hierarchical layout
63+
- Generate: Script layout generators, PCells and layout transformation tools
64+
- Analyze: Search, verify, and measure layout and code analysis scripts
65+
license: GPL-2.0-or-later
66+
license_family: GPL
67+
license_file: LICENSE
68+
doc_url: https://www.klayout.de/doc.html
69+
dev_url: https://github.com/KLayout/klayout
70+
71+
extra:
72+
recipe-maintainers:
73+
- curtisma
74+
- klayoutmatthias
75+
- proppy
76+
- flaport
77+
- joamatab

0 commit comments

Comments
 (0)