public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-text/cmigemo/, app-text/cmigemo/files/
@ 2024-04-28  6:16 Akinori Hattori
  0 siblings, 0 replies; only message in thread
From: Akinori Hattori @ 2024-04-28  6:16 UTC (permalink / raw
  To: gentoo-commits

commit:     3ca08dc865a28a3d885b4b4f44c3a45e828566b5
Author:     Akinori Hattori <hattya <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 28 06:09:35 2024 +0000
Commit:     Akinori Hattori <hattya <AT> gentoo <DOT> org>
CommitDate: Sun Apr 28 06:09:35 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ca08dc8

app-text/cmigemo: fix build

Closes: https://bugs.gentoo.org/881575
Closes: https://bugs.gentoo.org/882397
Signed-off-by: Akinori Hattori <hattya <AT> gentoo.org>

 app-text/cmigemo/cmigemo-1.3c-r4.ebuild            |   8 +-
 app-text/cmigemo/files/cmigemo-1.3c-gentoo.patch   |  10 ++
 .../files/cmigemo-1.3c-parallel-build.patch        |  73 +++++++++++++
 .../files/cmigemo-1.3c-parallel-install.patch      | 113 +++++++++++++++++++++
 4 files changed, 200 insertions(+), 4 deletions(-)

diff --git a/app-text/cmigemo/cmigemo-1.3c-r4.ebuild b/app-text/cmigemo/cmigemo-1.3c-r4.ebuild
index 3a03e2143a77..624176e11d29 100644
--- a/app-text/cmigemo/cmigemo-1.3c-r4.ebuild
+++ b/app-text/cmigemo/cmigemo-1.3c-r4.ebuild
@@ -31,6 +31,8 @@ PATCHES=(
 	# bug #246953
 	"${FILESDIR}"/${P}-gentoo.patch
 	"${FILESDIR}"/${P}-ldflags.patch
+	"${FILESDIR}"/${P}-parallel-build.patch
+	"${FILESDIR}"/${P}-parallel-install.patch
 )
 DOCS=( doc/{README_j,TODO_j,vimigemo}.txt )
 
@@ -48,8 +50,7 @@ src_prepare() {
 
 src_compile() {
 	append-flags -fPIC
-	# parallel make b0rked
-	emake -j1 \
+	emake \
 		CC="$(tc-getCC)" \
 		CFLAGS="${CFLAGS}" \
 		LDFLAGS="${LDFLAGS}" \
@@ -57,8 +58,7 @@ src_compile() {
 }
 
 src_install() {
-	# parallel make b0rked
-	emake -j1 \
+	emake \
 		prefix="${ED}/usr" \
 		libdir="${ED}/usr/$(get_libdir)" \
 		gcc-install

diff --git a/app-text/cmigemo/files/cmigemo-1.3c-gentoo.patch b/app-text/cmigemo/files/cmigemo-1.3c-gentoo.patch
index 7cda25704894..74c5f17b9c78 100644
--- a/app-text/cmigemo/files/cmigemo-1.3c-gentoo.patch
+++ b/app-text/cmigemo/files/cmigemo-1.3c-gentoo.patch
@@ -9,6 +9,16 @@
  
  include config.mk
  include compile/unix.mak
+--- a/compile/unix.mak
++++ b/compile/unix.mak
+@@ -22,6 +22,7 @@
+ 			$(MKDIR) $$i; \
+ 		fi \
+ 	done
++	touch $@
+ 
+ $(outdir)cmigemo$(EXEEXT): $(objdir)main.$(O) $(libmigemo_LIB)
+ 	$(CC) -o $@ $(objdir)main.$(O) -L. -L$(outdir) -lmigemo $(LDFLAGS)
 --- a/configure
 +++ b/configure
 @@ -31,12 +31,12 @@

diff --git a/app-text/cmigemo/files/cmigemo-1.3c-parallel-build.patch b/app-text/cmigemo/files/cmigemo-1.3c-parallel-build.patch
new file mode 100644
index 000000000000..b311754e1538
--- /dev/null
+++ b/app-text/cmigemo/files/cmigemo-1.3c-parallel-build.patch
@@ -0,0 +1,73 @@
+https://github.com/koron/cmigemo/pull/28
+
+From fd4bad807a9a52130d58269a4b1507a8720c5ae6 Mon Sep 17 00:00:00 2001
+From: Alyssa Ross <hi@alyssa.is>
+Date: Fri, 12 Nov 2021 15:16:54 +0000
+Subject: [PATCH] Add directory dependencies to fix parallel builds
+
+When building in parallel (make -j) sometimes make would try to create
+a dictionary file before the directory containing it had been
+created.  To fix this, I've made the directory a dependency of each
+file in it, rather than having them be sibling dependencies of the
+-files targets.
+---
+ dict/dict.mak | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/dict/dict.mak b/dict/dict.mak
+index 8ea8a66..44bd543 100644
+--- a/dict/dict.mak
++++ b/dict/dict.mak
+@@ -33,40 +33,40 @@ cp932:		$(DICT)
+ # Dictionary in euc-jp
+ #
+ euc-jp: 	cp932 euc-jp-files
+-euc-jp-files: $(EUCJP_DIR) $(EUCJP_DIR)/migemo-dict \
++euc-jp-files: $(EUCJP_DIR)/migemo-dict \
+ 	$(EUCJP_DIR)/zen2han.dat $(EUCJP_DIR)/han2zen.dat \
+ 	$(EUCJP_DIR)/hira2kata.dat $(EUCJP_DIR)/roma2hira.dat
+ $(EUCJP_DIR):
+ 	$(MKDIR) $(EUCJP_DIR)
+-$(EUCJP_DIR)/migemo-dict: migemo-dict
++$(EUCJP_DIR)/migemo-dict: $(EUCJP_DIR) migemo-dict
+ 	$(FILTER_EUCJP) < migemo-dict > $@
+-$(EUCJP_DIR)/zen2han.dat: zen2han.dat
++$(EUCJP_DIR)/zen2han.dat: $(EUCJP_DIR) zen2han.dat
+ 	$(FILTER_EUCJP) < zen2han.dat > $@
+-$(EUCJP_DIR)/han2zen.dat: han2zen.dat
++$(EUCJP_DIR)/han2zen.dat: $(EUCJP_DIR) han2zen.dat
+ 	$(FILTER_EUCJP) < han2zen.dat > $@
+-$(EUCJP_DIR)/hira2kata.dat: hira2kata.dat
++$(EUCJP_DIR)/hira2kata.dat: $(EUCJP_DIR) hira2kata.dat
+ 	$(FILTER_EUCJP) < hira2kata.dat > $@
+-$(EUCJP_DIR)/roma2hira.dat: roma2hira.dat
++$(EUCJP_DIR)/roma2hira.dat: $(EUCJP_DIR) roma2hira.dat
+ 	$(FILTER_EUCJP) < roma2hira.dat > $@
+ 
+ ##############################################################################
+ # Dictionary in utf-8
+ #
+ utf-8: 	cp932 utf-8-files
+-utf-8-files: $(UTF8_DIR) $(UTF8_DIR)/migemo-dict \
++utf-8-files: $(UTF8_DIR)/migemo-dict \
+ 	$(UTF8_DIR)/zen2han.dat $(UTF8_DIR)/han2zen.dat \
+ 	$(UTF8_DIR)/hira2kata.dat $(UTF8_DIR)/roma2hira.dat
+ $(UTF8_DIR):
+ 	$(MKDIR) $(UTF8_DIR)
+-$(UTF8_DIR)/migemo-dict: migemo-dict
++$(UTF8_DIR)/migemo-dict: $(UTF8_DIR) migemo-dict
+ 	$(FILTER_UTF8) < migemo-dict > $@
+-$(UTF8_DIR)/zen2han.dat: zen2han.dat
++$(UTF8_DIR)/zen2han.dat: $(UTF8_DIR) zen2han.dat
+ 	$(FILTER_UTF8) < zen2han.dat > $@
+-$(UTF8_DIR)/han2zen.dat: han2zen.dat
++$(UTF8_DIR)/han2zen.dat: $(UTF8_DIR) han2zen.dat
+ 	$(FILTER_UTF8) < han2zen.dat > $@
+-$(UTF8_DIR)/hira2kata.dat: hira2kata.dat
++$(UTF8_DIR)/hira2kata.dat: $(UTF8_DIR) hira2kata.dat
+ 	$(FILTER_UTF8) < hira2kata.dat > $@
+-$(UTF8_DIR)/roma2hira.dat: roma2hira.dat
++$(UTF8_DIR)/roma2hira.dat: $(UTF8_DIR) roma2hira.dat
+ 	$(FILTER_UTF8) < roma2hira.dat > $@
+ 
+ ##############################################################################

diff --git a/app-text/cmigemo/files/cmigemo-1.3c-parallel-install.patch b/app-text/cmigemo/files/cmigemo-1.3c-parallel-install.patch
new file mode 100644
index 000000000000..9ac30d65a3c0
--- /dev/null
+++ b/app-text/cmigemo/files/cmigemo-1.3c-parallel-install.patch
@@ -0,0 +1,113 @@
+https://github.com/koron/cmigemo/pull/29
+
+From 4c7476b614208836c3f4036fca87c8c718043c8b Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyich@gmail.com>
+Date: Wed, 22 Jun 2022 22:07:18 +0100
+Subject: [PATCH 1/3] compile/unix.mak: add .o file dependency on $(objdir)
+ directory
+
+Without this change parallel build fails occasionally when object
+files are built before directory is being created:
+
+    make[1]: Entering directory '/build/cmigemo'
+    gcc -O2 -Wall  -fPIC -o build/object/charset.o -c src/charset.c
+    Assembler messages:
+    Fatal error: can't create build/object/charset.o: No such file or directory
+    make[1]: *** [compile/unix.mak:33: build/object/charset.o] Error 1 shuffle=1655929862
+---
+ compile/unix.mak | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/compile/unix.mak b/compile/unix.mak
+index 8ef6413..8cf525a 100644
+--- a/compile/unix.mak
++++ b/compile/unix.mak
+@@ -14,7 +14,7 @@ CFLAGS	= -O2 -Wall $(DEFINES) $(CFLAGS_MIGEMO)
+ LDFLAGS = $(LDFLAGS_MIGEMO)
+ LIBS	= 
+ 
+-default: dirs $(outdir)cmigemo$(EXEEXT)
++default: $(outdir)cmigemo$(EXEEXT)
+ 
+ dirs:
+ 	@for i in $(objdir) $(outdir); do \
+@@ -26,10 +26,10 @@ dirs:
+ $(outdir)cmigemo$(EXEEXT): $(objdir)main.$(O) $(libmigemo_LIB)
+ 	$(CC) -o $@ $(objdir)main.$(O) -L. -L$(outdir) -lmigemo $(LDFLAGS)
+ 
+-$(objdir)main.o: $(srcdir)main.c
++$(objdir)main.o: $(srcdir)main.c dirs
+ 	$(CC) $(CFLAGS) -o $@ -c $<
+ 
+-$(objdir)%.o: $(srcdir)%.c
++$(objdir)%.o: $(srcdir)%.c dirs
+ 	$(CC) $(CFLAGS) -o $@ -c $<
+ 
+ ##############################################################################
+
+From 88a1ed71a637faa6ec4eeb7e2b2f0a9f597a4812 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyich@gmail.com>
+Date: Wed, 22 Jun 2022 22:10:42 +0100
+Subject: [PATCH 2/3] compile/unix.mak: add install dependency on $(dictdir)
+ directory
+
+Without this change parallel install fails occasionally when
+$(dictdir) is not yet present:
+
+    gcc -o build/cmigemo ./build/object/main.o -L. -L./build/ -lmigemo -Wl,-rpath,.,-rpath,/usr/local/lib,-rpath,/usr/lib
+    install -m 644 dict/migemo-dict ...-cmigemo-1.3e/share/migemo/cp932
+    install: cannot create regular file '...-cmigemo-1.3e/share/migemo/cp932': No such file or directory
+    make[1]: *** [compile/unix.mak:49: install-dict] Error 1 shuffle=1655931959
+---
+ compile/unix.mak | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/compile/unix.mak b/compile/unix.mak
+index 8cf525a..cb6bd8f 100644
+--- a/compile/unix.mak
++++ b/compile/unix.mak
+@@ -45,7 +45,7 @@ install-mkdir:
+ 	$(MKDIR) $(dictdir)/euc-jp
+ 	$(MKDIR) $(dictdir)/utf-8
+ 
+-install-dict:
++install-dict: install-mkdir
+ 	$(INSTALL_DATA) dict/migemo-dict $(dictdir)/cp932
+ 	$(INSTALL_DATA) dict/han2zen.dat $(dictdir)/cp932
+ 	$(INSTALL_DATA) dict/hira2kata.dat $(dictdir)/cp932
+
+From 3b39db8a748081e60bcceb7a8ae93616a5939f41 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyich@gmail.com>
+Date: Wed, 22 Jun 2022 22:16:12 +0100
+Subject: [PATCH 3/3] compile/unix.mak: add install-lib dependency on $(libdir)
+ directory
+
+Without this change parallel install fails occasionally when
+$(libdir) is not yet present:
+
+    rm -f libmigemo.so.1 libmigemo.so
+    ln -s libmigemo.so.1.1.0 libmigemo.so.1
+    ln -s libmigemo.so.1.1.0 libmigemo.so
+    install -m 755 libmigemo.so.1.1.0 ...-cmigemo-1.3e/lib
+    rm -f ...-cmigemo-1.3e/lib/libmigemo.so.1 ...-cmigemo-1.3e/lib/libmigemo.so
+    ln -s libmigemo.so.1.1.0 ...-cmigemo-1.3e/lib/libmigemo.so.1
+    ln: failed to create symbolic link '...-cmigemo-1.3e/lib/libmigemo.so.1': Not a directory
+    make[1]: *** [compile/Make_gcc.mak:38: install-lib] Error 1 shuffle=1655932664
+---
+ compile/unix.mak | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/compile/unix.mak b/compile/unix.mak
+index cb6bd8f..6651fcd 100644
+--- a/compile/unix.mak
++++ b/compile/unix.mak
+@@ -66,6 +66,9 @@ install-dict: install-mkdir
+ 	  $(INSTALL_DATA) dict/utf-8.d/zen2han.dat $(dictdir)/utf-8; \
+ 	fi
+ 
++# depends on $(libdir) to be already present
++install-lib: install-mkdir
++
+ install: $(outdir)cmigemo$(EXEEXT) $(libmigemo_DSO) install-mkdir install-dict install-lib
+ 	$(INSTALL_DATA) $(srcdir)migemo.h $(incdir)
+ 	$(INSTALL_DATA) doc/README_j.txt $(docdir)


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-28  6:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-28  6:16 [gentoo-commits] repo/gentoo:master commit in: app-text/cmigemo/, app-text/cmigemo/files/ Akinori Hattori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox