about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/yosys/plugins/synlig-makefile-for-nix.patch
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-10-20 22:09:03 +0000
committerAlyssa Ross <hi@alyssa.is>2023-10-20 22:09:03 +0000
commit50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e (patch)
treef2556b911180125ccbb7ed0e78a54e92da89adce /nixpkgs/pkgs/development/compilers/yosys/plugins/synlig-makefile-for-nix.patch
parent4c16d4548a98563c9d9ad76f4e5b2202864ccd54 (diff)
parentcfc75eec4603c06503ae750f88cf397e00796ea8 (diff)
downloadnixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.gz
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.bz2
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.lz
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.xz
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.zst
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.zip
Merge commit 'cfc75eec4603c06503ae750f88cf397e00796ea8'
Conflicts:
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/yosys/plugins/synlig-makefile-for-nix.patch')
-rw-r--r--nixpkgs/pkgs/development/compilers/yosys/plugins/synlig-makefile-for-nix.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/compilers/yosys/plugins/synlig-makefile-for-nix.patch b/nixpkgs/pkgs/development/compilers/yosys/plugins/synlig-makefile-for-nix.patch
new file mode 100644
index 000000000000..7d1f407d6fdc
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/yosys/plugins/synlig-makefile-for-nix.patch
@@ -0,0 +1,66 @@
+diff --git a/Makefile b/Makefile
+index 4c96ae7..9e1a2e3 100755
+--- a/Makefile
++++ b/Makefile
+@@ -3,7 +3,7 @@
+ # Setup make itself.
+ 
+ .ONESHELL:
+-override SHELL := /bin/bash
++SHELL := bash
+ override .SHELLFLAGS := -e -u -o pipefail -O nullglob -O extglob -O globstar -c
+ 
+ # Unset all default build- and recipe-related variables.
+@@ -315,7 +315,6 @@ endif
+ GetTargetStructName = target[${1}]
+ 
+ makefiles_to_include := \
+-	third_party/Build.*.mk \
+ 	frontends/*/Build.mk \
+ 	tests/*/Build.mk \
+ 	lib/*/Build.mk
+diff --git a/frontends/systemverilog/Build.mk b/frontends/systemverilog/Build.mk
+index acd9cb6..c039994 100644
+--- a/frontends/systemverilog/Build.mk
++++ b/frontends/systemverilog/Build.mk
+@@ -1,6 +1,7 @@
+ t       := systemverilog-plugin
+ ts      := $(call GetTargetStructName,${t})
+ out_dir := $(call GetTargetBuildDir,${t})
++mod_dir := third_party/yosys_mod
+ 
+ cxx_is_clang := $(findstring clang,$(notdir ${CXX}))
+ 
+@@ -13,9 +14,9 @@ ${ts}.sources := \
+ 	${${ts}.src_dir}uhdm_ast_frontend.cc \
+ 	${${ts}.src_dir}uhdm_common_frontend.cc \
+ 	${${ts}.src_dir}uhdm_surelog_ast_frontend.cc \
+-	${$(call GetTargetStructName,yosys).mod_dir}const2ast.cc \
+-	${$(call GetTargetStructName,yosys).mod_dir}edif.cc \
+-	${$(call GetTargetStructName,yosys).mod_dir}simplify.cc
++	$(mod_dir)/const2ast.cc \
++	$(mod_dir)/edif.cc \
++	$(mod_dir)/simplify.cc
+ 
+ define ${ts}.env =
+ export PKG_CONFIG_PATH=$(call ShQuote,${$(call GetTargetStructName,surelog).output_vars.PKG_CONFIG_PATH}$(if ${PKG_CONFIG_PATH},:${PKG_CONFIG_PATH}))
+@@ -35,8 +36,8 @@ endif
+ endif
+ 
+ ${ts}.cxxflags = \
+-	-I${$(call GetTargetStructName,yosys).src_dir} \
+-	-I${$(call GetTargetStructName,yosys).mod_dir} \
++	-I$(shell yosys-config --cxxflags) \
++	-I$(mod_dir) \
+ 	-D_YOSYS_ \
+ 	-DYOSYS_ENABLE_PLUGINS \
+ 	$(shell ${${ts}.env}; pkg-config --cflags Surelog) \
+@@ -55,7 +56,7 @@ ${ts}.ldflags = \
+ 	$(shell ${${ts}.env}; pkg-config --libs-only-L Surelog) \
+ 	${build_type_ldflags} \
+ 	${LDFLAGS} \
+-	-Wl,--export-dynamic
++	$(shell yosys-config --ldflags --ldlibs)
+ 
+ ${ts}.ldlibs = \
+ 	$(shell ${${ts}.env}; pkg-config --libs-only-l --libs-only-other Surelog) \