summaryrefslogtreecommitdiff
path: root/media-libs/openctm
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-12-25 23:06:25 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-12-25 23:06:25 +0000
commit441d1370330332b7d78f238d2f5e13f7aed5e4e0 (patch)
tree6a5171dd615dfeee62a45044144c66e864738fb0 /media-libs/openctm
parentab3da91fb6c91a9df52fff8f991570f456fd3c7a (diff)
gentoo christmass resync : 25.12.2020
Diffstat (limited to 'media-libs/openctm')
-rw-r--r--media-libs/openctm/Manifest14
-rw-r--r--media-libs/openctm/files/openctm-1.0.3-create-lib-with-correct-soname-and-symlinks.patch30
-rw-r--r--media-libs/openctm/files/openctm-1.0.3-do-not-set-rpath.patch19
-rw-r--r--media-libs/openctm/files/openctm-1.0.3-escape-hyphens-in-ctmconv-man-page.patch11
-rw-r--r--media-libs/openctm/files/openctm-1.0.3-fix-install-paths.patch32
-rw-r--r--media-libs/openctm/files/openctm-1.0.3-link-ctmviewer-only-with-necessary-gtk-libs.patch13
-rw-r--r--media-libs/openctm/files/openctm-1.0.3-link-ctmviewer-with-libGL.patch11
-rw-r--r--media-libs/openctm/files/openctm-1.0.3-link-ctmviewer-with-libGLU.patch11
-rw-r--r--media-libs/openctm/files/openctm-1.0.3-no-strip.patch32
-rw-r--r--media-libs/openctm/files/openctm-1.0.3-respect-flags.patch79
-rw-r--r--media-libs/openctm/files/openctm-1.0.3-use-system-libs.patch81
-rw-r--r--media-libs/openctm/metadata.xml3
-rw-r--r--media-libs/openctm/openctm-1.0.3-r1.ebuild57
13 files changed, 392 insertions, 1 deletions
diff --git a/media-libs/openctm/Manifest b/media-libs/openctm/Manifest
index 384c0d890465..3ce828d71d5e 100644
--- a/media-libs/openctm/Manifest
+++ b/media-libs/openctm/Manifest
@@ -1,5 +1,17 @@
+AUX openctm-1.0.3-create-lib-with-correct-soname-and-symlinks.patch 722 BLAKE2B 09a4cbfb50cfbadd4367e6f944169cb10b59a11b060c76422f3d2147ca8e1ac233b1d0c41dcef4c155ac04f9bcb13b84227dab19c776e89fb20a10bb849d29ac SHA512 86a2232fbb58d1d4d262512963016ed3e9372c22f5f7f85560f47b05332e6f3c10c3029f16318c79bea9dc5968089dace880afaa4e325ffe9e09fcb635099a17
+AUX openctm-1.0.3-do-not-set-rpath.patch 895 BLAKE2B 8cda8a3c13d5bb2db05bfca4b17b1f2405c33f137720b4a5dc7944e8857ffb7eddfd6a2566cd5e4facd0e39b18f0f6f9cd6a8701e75a12ad617874415168545e SHA512 e3a0fe886cdabd2f7fa52f2c1fc268d94230cd101838a3d4260054b412d70e58e1c195837cd8a01895d05c97da171a86919205ad3fd05757818c9b342b431bce
+AUX openctm-1.0.3-escape-hyphens-in-ctmconv-man-page.patch 305 BLAKE2B f5ca2982837b86e25c87aaec43f50cd45d5037228c846f5b35acf0b214b6b34f8528297213303374cd2e77c347cdb443659b820d891f1b2ce9f68e5237727615 SHA512 40469f718f28db9caad6fcaa2728c7a3c56d5ad60c0d39929e871d9348801ad2aef2cbe5112cb785f9d2b794209bfd2bbe9d5d583ad77567a632c8e21efbfab1
+AUX openctm-1.0.3-fix-install-paths.patch 838 BLAKE2B 4849dc0ecc20f9b3a8bdbe1a033696b4755c6254e6e5b55838b5e60999cda52466d8f34e8444ec5666f19254a285e7fd2cb5cf344af2377c7a09ed1dfdf867dd SHA512 d1c47b171636cfdeebeb310c7553e9fba18e7b36a66e2659a32a5ea878ee3f17f842ac4fcba34e965dbc1865f17f4883f569763ca3ec12adfc55d944997b8e53
+AUX openctm-1.0.3-link-ctmviewer-only-with-necessary-gtk-libs.patch 559 BLAKE2B e0a09ed99bc50957051f7867183c95ec7df43cbf17e4285ebb0cc43414eb7289260dd4288afe3a8355c18c7d20df4cdeb88b63cf8ef9f726943a1cba56756600 SHA512 4d0d6a0f64c9095a38874471d638c31657c8df5f53a803b43ee1e2e8794ecf519075de95dcfaff3bfa62af14a7c534b4abac9869188a368e4b3bc2c5eafd679b
+AUX openctm-1.0.3-link-ctmviewer-with-libGL.patch 349 BLAKE2B d1d8571b867c735df8418d119b50327d6899509e9bf4bd19abd25272797e5c794671c0af67ed693d33a30c666eafb03b2fe460015a154e4b99fff8846022ff8e SHA512 a1c00ae7a8f77b0bc6fc1a437352726cb42fdacb98bb17c4d4bd1f1ca2d92c552c5805ff7115f00d64610e10ad397bfdd26c0c7937eb0a74805a8f9e631257d4
+AUX openctm-1.0.3-link-ctmviewer-with-libGLU.patch 747 BLAKE2B 9f2599e9cbe0dc8fd0ed6b801ce2afa82fd216caa218e28d264aa64a33d1a1eb24e0080bf20bfc7231244253b7e654121def33df7ce8e9735d89c1c04861efb7 SHA512 71a6a4ce3bc352f376f83d7bb26167159bb3aa8f45d3e1134cb703a16a847453eb60de2b50c2aa470e77b837d260375832d5a3941de54891063ab0c169a38d98
+AUX openctm-1.0.3-no-strip.patch 1272 BLAKE2B 78cceaee9185d913d06bcd4ca61447c45cab782388401ff71842fe093bc1f0ef76ec90d0e27a752d3a78f2782ef6cf7b8fdbd773016e465acff6aaf4430ec69d SHA512 a808a499b5a3162831d7b7d67433ef71f1f31e634e2f5057f4f19b59ee962e0379eadad57342a3a24f9891809c2b24adc83abcc311fef990d97446d4baa318cb
+AUX openctm-1.0.3-respect-flags.patch 2931 BLAKE2B fa6b99c7fa46ce5a0f1790cbf89ac45ac19ea939ff165cece87e419f1c902de8d3528c82ad800da079aa07b4f03fd33df47eed07bb61cb60d3326146f91e6153 SHA512 a6d6efa9df63835cb0990906a5755cc6d673a48377af1f28b880384051e4cb2380deae13eff864c179e7e98b3e0319e993c639609bc8b482e3ea37fbf4cb21cd
+AUX openctm-1.0.3-use-system-libs.patch 3289 BLAKE2B d0402954c36ea42372fd65858ef1166fd519e133b3f2f4e5770fd5a76f9f8dc31354749df7af97b7bf050b47c6327f7aa6253eeb7cd4225c55c1dc6e1ac3aebd SHA512 a12e45f703373749e1c71ddfb11576d056b2970de32800bf6fa46332cb23c8e6c5e3e741bc30468599b7a66918e9bd1140e50d5963fba5c71dfaa6649d64a66a
AUX openctm-fix-makefiles.patch 6672 BLAKE2B 5cc7ad6b882bd4bb3cb05d112dd953807c029b39524bcb17c0f054b99fdf4bd3363d1807d0979c55cc6c746020236f99e48db2cf59b9ff62684e4e7963eb0681 SHA512 96cbe3775632d5b86ba5bb08b283707b5e89ffb0b837b2366f88955eb35341e02ea33de1b2562f87692b359d1b28a96833a163ec1d29f6f266cd641de972a527
AUX openctm-no-strip.patch 1654 BLAKE2B e284556eb0d7866e527002bdbf291701654dd99a8353592c1dd5f93f6f74bbe4797da4bbc7960d4d7b875734fa4edbff68032c6835cbb26c0bb6f9cf0a471df3 SHA512 a38c4647a0113892d2294efec96efb073cec4d5771c383cd7454422195f230b0326610905534e758fb1f1bf36a6dca1810005f603f70d73584093b8895a99ec0
+DIST openctm-1.0.3-src.tar.bz2 1507603 BLAKE2B 379dad88ef3b069ee4167bdee8c1e86c6f1250c0db7bb108d12b6005f0cd19a4cafcaae51a8e1eddde7566fc9c8e361472268edb1806a5383f536d070ea4354a SHA512 fdfa08d19ecbfea99ba01aa2032e941ed6313394a96bd69f8984c2d2d079d836c616471d2bdf6f40175e75659f3ad0ba41502bc3d8224091472f40893ea8746e
DIST openctm_1.0.3+dfsg1.orig.tar.bz2 179792 BLAKE2B 446fedc14e646b7cfc0aaac2d4f9b224482d74bf4faadd866b7121392e3863e3e42fe57f35654d4e9d7c056b3b8069dfb4668660d97ce7266d7850026654a88c SHA512 4ea8c9230e01b57fce4d741df77713df8fb0493fbb20c8d4b183e3e8cec16f97e8003d2569b1c7cac07a17d334711673c0fed0c6c050bbdb901028ee9f6c32f6
+EBUILD openctm-1.0.3-r1.ebuild 1415 BLAKE2B bf2c58839ee94c3e2a7f9265a2f9031bc27a494f4bb9977e317fc99fd98b1712bbab90372dcda5a77483cc6dac67a60725a885896b7b67f8c5185fcea6ebada8 SHA512 9e25921489dd8476d8418dc8c62684de641d7c21fde7aa3a7d89103d1e62c680d9919c7fe81524f305a6b0ae763cbd127ba08a9063d6e5287580ba509a8b22d8
EBUILD openctm-1.0.3.ebuild 924 BLAKE2B 1cb9e32be2a294baa203a10675fa9b33321625a7c5129af388f906a96e3de4762d83146197b835032f9d78a511cd42f0920d27e5b7ecb4f035a934863d8cf6c5 SHA512 a75a3bb34941102b35be2c17023c5af6dba7851b322969bfa3fdf698fd20c6b4b632cd1c7e4c761046f4744616163ffbea45be80f71eee9bbe3c988d3ee92f0a
-MISC metadata.xml 595 BLAKE2B 143f65cc923e4de9305139118c3ca3166c2efcb5b50c9420c0045566384bae0163fc600d2a1d6206afc0abb440e24e7edfc9d5bc6a5e6b080242357440edd3b8 SHA512 04911c1a3a676469a111a02a2a04c3a988e9f9a738f1b3933b5c4c7917f7e65d558d1fd714122127f791bb5998390e2f85794f673f257ed96a37b4d017662c5b
+MISC metadata.xml 665 BLAKE2B 04fec51f9d81997088613e4ca3b4d1d12643e597bbd91896d78a06c90886abaa857785895e8b29b8284afb975594a68c0a046b050360ad971bf964e596398bbe SHA512 79591a66512551c42e4d28d9abaccd3a564b0fb89fb12b52bba9b130704bc6f04d13565f7b0ec41f7b7b79454d49c2002e0aebf48e7e71665c78f8de2f9cb201
diff --git a/media-libs/openctm/files/openctm-1.0.3-create-lib-with-correct-soname-and-symlinks.patch b/media-libs/openctm/files/openctm-1.0.3-create-lib-with-correct-soname-and-symlinks.patch
new file mode 100644
index 000000000000..6b91f43aff7b
--- /dev/null
+++ b/media-libs/openctm/files/openctm-1.0.3-create-lib-with-correct-soname-and-symlinks.patch
@@ -0,0 +1,30 @@
+--- a/lib/Makefile.linux
++++ b/lib/Makefile.linux
+@@ -33,7 +33,11 @@
+ RM = rm -f
+ DEPEND = $(CPP) -MM
+
+-DYNAMICLIB = libopenctm.so
++VERSION = 1.0.3
++SOVERSION = 1
++LIBNAME = libopenctm.so
++SONAME = $(LIBNAME).$(SOVERSION)
++DYNAMICLIB = $(LIBNAME).$(VERSION)
+
+ OBJS = openctm.o \
+ stream.o \
+@@ -64,10 +68,12 @@
+ all: $(DYNAMICLIB)
+
+ clean:
+- $(RM) $(DYNAMICLIB) $(OBJS) $(LZMA_OBJS)
++ $(RM) $(DYNAMICLIB) $(SONAME) $(LIBNAME) $(OBJS) $(LZMA_OBJS)
+
+ $(DYNAMICLIB): $(OBJS) $(LZMA_OBJS)
+- gcc -shared -s -Wl,-soname,$@ -o $@ $(OBJS) $(LZMA_OBJS) -lm
++ gcc -shared -s -Wl,-soname,$(SONAME) -o $@ $(OBJS) $(LZMA_OBJS) -lm
++ ln -s $(DYNAMICLIB) $(SONAME)
++ ln -s $(DYNAMICLIB) $(LIBNAME)
+
+ %.o: %.c
+ $(CC) $(CFLAGS) $<
diff --git a/media-libs/openctm/files/openctm-1.0.3-do-not-set-rpath.patch b/media-libs/openctm/files/openctm-1.0.3-do-not-set-rpath.patch
new file mode 100644
index 000000000000..e80e5cf34b4c
--- /dev/null
+++ b/media-libs/openctm/files/openctm-1.0.3-do-not-set-rpath.patch
@@ -0,0 +1,19 @@
+--- a/tools/Makefile.linux
++++ b/tools/Makefile.linux
+@@ -43,13 +43,13 @@
+ rm -f ctmconv ctmviewer ctmbench $(CTMCONVOBJS) $(CTMVIEWEROBJS) $(CTMBENCHOBJS) bin2c phong_frag.h phong_vert.h
+
+ ctmconv: $(CTMCONVOBJS)
+- $(CPP) -s -o $@ -L$(OPENCTMDIR) $(CTMCONVOBJS) -Wl,-rpath,. -lopenctm -ltinyxml
++ $(CPP) -s -o $@ -L$(OPENCTMDIR) $(CTMCONVOBJS) -lopenctm -ltinyxml
+
+ ctmviewer: $(CTMVIEWEROBJS)
+- $(CPP) -s -o $@ -L$(OPENCTMDIR) $(CTMVIEWEROBJS) -Wl,-rpath,. -lopenctm -ltinyxml -ljpeg -lpnglite -lz -lglut -lGLU -lGLEW `pkg-config --libs gtk+-2.0`
++ $(CPP) -s -o $@ -L$(OPENCTMDIR) $(CTMVIEWEROBJS) -lopenctm -ltinyxml -ljpeg -lpnglite -lz -lglut -lGLU -lGLEW `pkg-config --libs gtk+-2.0`
+
+ ctmbench: $(CTMBENCHOBJS)
+- $(CPP) -s -o $@ -L$(OPENCTMDIR) $(CTMBENCHOBJS) -Wl,-rpath,. -lopenctm
++ $(CPP) -s -o $@ -L$(OPENCTMDIR) $(CTMBENCHOBJS) -lopenctm
+
+ %.o: %.cpp
+ $(CPP) $(CPPFLAGS) -o $@ $<
diff --git a/media-libs/openctm/files/openctm-1.0.3-escape-hyphens-in-ctmconv-man-page.patch b/media-libs/openctm/files/openctm-1.0.3-escape-hyphens-in-ctmconv-man-page.patch
new file mode 100644
index 000000000000..4f0a5d598898
--- /dev/null
+++ b/media-libs/openctm/files/openctm-1.0.3-escape-hyphens-in-ctmconv-man-page.patch
@@ -0,0 +1,11 @@
+--- a/doc/ctmconv.1
++++ b/doc/ctmconv.1
+@@ -24,7 +24,7 @@
+ Scale the mesh by a scalar factor.
+ .TP
+ .B --upaxis arg
+-Set up axis (X, Y, Z, -X, -Y, -Z). If != Z, the mesh will be flipped.
++Set up axis (X, Y, Z, \-X, \-Y, \-Z). If != Z, the mesh will be flipped.
+ .TP
+ .B --flip
+ Flip triangle orientation.
diff --git a/media-libs/openctm/files/openctm-1.0.3-fix-install-paths.patch b/media-libs/openctm/files/openctm-1.0.3-fix-install-paths.patch
new file mode 100644
index 000000000000..dd2e0c425f7b
--- /dev/null
+++ b/media-libs/openctm/files/openctm-1.0.3-fix-install-paths.patch
@@ -0,0 +1,32 @@
+--- a/Makefile.linux
++++ b/Makefile.linux
+@@ -47,19 +47,21 @@
+
+
+ # Installation settings
+-LIBDIR = /usr/lib/
+-INCDIR = /usr/local/include/
+-BINDIR = /usr/local/bin/
+-MAN1DIR = /usr/local/share/man/man1/
+-CP = cp
++LIBDIR = $(DESTDIR)/usr/$GENTOO_LIBDIR@/$(DEB_HOST_MULTIARCH)
++INCDIR = $(DESTDIR)/usr/include/
++BINDIR = $(DESTDIR)/usr/bin/
++MAN1DIR = $(DESTDIR)/usr/share/man/man1/
++CP = cp -P
+ MKDIR = mkdir -p
+
+-install:
+- $(CP) lib/libopenctm.so $(LIBDIR)
++$(LIBDIR) $(INCDIR) $(BINDIR) $(MAN1DIR):
++ $(MKDIR) -p "$@"
++
++install: $(LIBDIR) $(INCDIR) $(BINDIR) $(MAN1DIR)
++ $(CP) lib/libopenctm.so* $(LIBDIR)
+ $(CP) lib/openctm.h $(INCDIR)
+ $(CP) lib/openctmpp.h $(INCDIR)
+ $(CP) tools/ctmconv $(BINDIR)
+ $(CP) tools/ctmviewer $(BINDIR)
+- $(MKDIR) $(MAN1DIR)
+ $(CP) doc/ctmconv.1 $(MAN1DIR)
+ $(CP) doc/ctmviewer.1 $(MAN1DIR)
diff --git a/media-libs/openctm/files/openctm-1.0.3-link-ctmviewer-only-with-necessary-gtk-libs.patch b/media-libs/openctm/files/openctm-1.0.3-link-ctmviewer-only-with-necessary-gtk-libs.patch
new file mode 100644
index 000000000000..370960721b5c
--- /dev/null
+++ b/media-libs/openctm/files/openctm-1.0.3-link-ctmviewer-only-with-necessary-gtk-libs.patch
@@ -0,0 +1,13 @@
+--- a/tools/Makefile.linux
++++ b/tools/Makefile.linux
+@@ -46,7 +46,9 @@
+ $(CPP) -s -o $@ -L$(OPENCTMDIR) $(CTMCONVOBJS) -lopenctm -ltinyxml
+
+ ctmviewer: $(CTMVIEWEROBJS)
+- $(CPP) -s -o $@ -L$(OPENCTMDIR) $(CTMVIEWEROBJS) -lopenctm -ltinyxml -ljpeg -lpnglite -lz -lglut -lGLU -lGLEW `pkg-config --libs gtk+-2.0`
++ $(CPP) -s -o $@ -L$(OPENCTMDIR) $(CTMVIEWEROBJS) -lopenctm \
++ -ltinyxml -ljpeg -lpnglite -lz -lglut -lGLU -lGLEW \
++ -lgtk-x11-2.0 -lgobject-2.0 -lglib-2.0
+
+ ctmbench: $(CTMBENCHOBJS)
+ $(CPP) -s -o $@ -L$(OPENCTMDIR) $(CTMBENCHOBJS) -lopenctm
diff --git a/media-libs/openctm/files/openctm-1.0.3-link-ctmviewer-with-libGL.patch b/media-libs/openctm/files/openctm-1.0.3-link-ctmviewer-with-libGL.patch
new file mode 100644
index 000000000000..b8409d4423d4
--- /dev/null
+++ b/media-libs/openctm/files/openctm-1.0.3-link-ctmviewer-with-libGL.patch
@@ -0,0 +1,11 @@
+--- a/tools/Makefile.linux
++++ b/tools/Makefile.linux
+@@ -47,7 +47,7 @@
+
+ ctmviewer: $(CTMVIEWEROBJS)
+ $(CPP) -s -o $@ -L$(OPENCTMDIR) $(CTMVIEWEROBJS) -lopenctm \
+- -ltinyxml -ljpeg -lpnglite -lz -lglut -lGLU -lGLEW \
++ -ltinyxml -ljpeg -lpnglite -lz -lGL -lglut -lGLU -lGLEW \
+ -lgtk-x11-2.0 -lgobject-2.0 -lglib-2.0
+
+ ctmbench: $(CTMBENCHOBJS)
diff --git a/media-libs/openctm/files/openctm-1.0.3-link-ctmviewer-with-libGLU.patch b/media-libs/openctm/files/openctm-1.0.3-link-ctmviewer-with-libGLU.patch
new file mode 100644
index 000000000000..1bf5d03e02d0
--- /dev/null
+++ b/media-libs/openctm/files/openctm-1.0.3-link-ctmviewer-with-libGLU.patch
@@ -0,0 +1,11 @@
+--- a/tools/Makefile.linux
++++ b/tools/Makefile.linux
+@@ -56,7 +56,7 @@
+ $(CPP) -s -o $@ -L$(OPENCTMDIR) -L$(TINYXMLDIR) $(CTMCONVOBJS) -Wl,-rpath,. -lopenctm -ltinyxml
+
+ ctmviewer: $(CTMVIEWEROBJS) $(JPEGDIR)/libjpeg.a $(TINYXMLDIR)/libtinyxml.a $(ZLIBDIR)/libz.a libopenctm.so
+- $(CPP) -s -o $@ -L$(OPENCTMDIR) -L$(TINYXMLDIR) -L$(JPEGDIR) -L$(ZLIBDIR) $(CTMVIEWEROBJS) -Wl,-rpath,. -lopenctm -ltinyxml -ljpeg -lz -lglut `pkg-config --libs gtk+-2.0`
++ $(CPP) -s -o $@ -L$(OPENCTMDIR) -L$(TINYXMLDIR) -L$(JPEGDIR) -L$(ZLIBDIR) $(CTMVIEWEROBJS) -Wl,-rpath,. -lopenctm -ltinyxml -ljpeg -lz -lglut -lGLU `pkg-config --libs gtk+-2.0`
+
+ ctmbench: $(CTMBENCHOBJS) libopenctm.so
+ $(CPP) -s -o $@ -L$(OPENCTMDIR) $(CTMBENCHOBJS) -Wl,-rpath,. -lopenctm
diff --git a/media-libs/openctm/files/openctm-1.0.3-no-strip.patch b/media-libs/openctm/files/openctm-1.0.3-no-strip.patch
new file mode 100644
index 000000000000..e42165c520bb
--- /dev/null
+++ b/media-libs/openctm/files/openctm-1.0.3-no-strip.patch
@@ -0,0 +1,32 @@
+--- a/lib/Makefile.linux
++++ b/lib/Makefile.linux
+@@ -71,7 +71,7 @@
+ $(RM) $(DYNAMICLIB) $(SONAME) $(LIBNAME) $(OBJS) $(LZMA_OBJS)
+
+ $(DYNAMICLIB): $(OBJS) $(LZMA_OBJS)
+- $(CC) $(LDFLAGS) -shared -s -Wl,-soname,$(SONAME) -o $@ $(OBJS) $(LZMA_OBJS) -lm
++ $(CC) $(LDFLAGS) -shared -Wl,-soname,$(SONAME) -o $@ $(OBJS) $(LZMA_OBJS) -lm
+ ln -s $(DYNAMICLIB) $(SONAME)
+ ln -s $(DYNAMICLIB) $(LIBNAME)
+
+--- a/tools/Makefile.linux
++++ b/tools/Makefile.linux
+@@ -42,15 +42,15 @@
+ rm -f ctmconv ctmviewer ctmbench $(CTMCONVOBJS) $(CTMVIEWEROBJS) $(CTMBENCHOBJS) bin2c phong_frag.h phong_vert.h
+
+ ctmconv: $(CTMCONVOBJS)
+- $(CXX) $(LDFLAGS) -s -o $@ -L$(OPENCTMDIR) $(CTMCONVOBJS) -lopenctm -ltinyxml
++ $(CXX) $(LDFLAGS) -o $@ -L$(OPENCTMDIR) $(CTMCONVOBJS) -lopenctm -ltinyxml
+
+ ctmviewer: $(CTMVIEWEROBJS)
+- $(CXX) $(LDFLAGS) -s -o $@ -L$(OPENCTMDIR) $(CTMVIEWEROBJS) -lopenctm \
++ $(CXX) $(LDFLAGS) -o $@ -L$(OPENCTMDIR) $(CTMVIEWEROBJS) -lopenctm \
+ -ltinyxml -ljpeg -lpnglite -lz -lGL -lglut -lGLU -lGLEW \
+ -lgtk-x11-2.0 -lgobject-2.0 -lglib-2.0
+
+ ctmbench: $(CTMBENCHOBJS)
+- $(CXX) $(LDFLAGS) -s -o $@ -L$(OPENCTMDIR) $(CTMBENCHOBJS) -lopenctm
++ $(CXX) $(LDFLAGS) -o $@ -L$(OPENCTMDIR) $(CTMBENCHOBJS) -lopenctm
+
+ %.o: %.cpp
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
diff --git a/media-libs/openctm/files/openctm-1.0.3-respect-flags.patch b/media-libs/openctm/files/openctm-1.0.3-respect-flags.patch
new file mode 100644
index 000000000000..4a406d0caf88
--- /dev/null
+++ b/media-libs/openctm/files/openctm-1.0.3-respect-flags.patch
@@ -0,0 +1,79 @@
+--- a/lib/Makefile.linux
++++ b/lib/Makefile.linux
+@@ -27,9 +27,9 @@
+ ###############################################################################
+
+ LZMADIR = liblzma
+-CC = gcc
+-CFLAGS = -O3 -W -Wall -c -fPIC -DOPENCTM_BUILD -I$(LZMADIR) -DLZMA_PREFIX_CTM -std=c99 -pedantic
+-CFLAGS_LZMA = -O3 -W -Wall -c -fPIC -DLZMA_PREFIX_CTM -std=c99 -pedantic
++CFLAGS += -W -Wall -c -fPIC -std=c99 -pedantic
++INCDEF = -DOPENCTM_BUILD -I$(LZMADIR) -DLZMA_PREFIX_CTM
++INCDEF_LZMA = -DLZMA_PREFIX_CTM
+ RM = rm -f
+ DEPEND = $(CPP) -MM
+
+@@ -71,15 +71,15 @@
+ $(RM) $(DYNAMICLIB) $(SONAME) $(LIBNAME) $(OBJS) $(LZMA_OBJS)
+
+ $(DYNAMICLIB): $(OBJS) $(LZMA_OBJS)
+- gcc -shared -s -Wl,-soname,$(SONAME) -o $@ $(OBJS) $(LZMA_OBJS) -lm
++ $(CC) $(LDFLAGS) -shared -s -Wl,-soname,$(SONAME) -o $@ $(OBJS) $(LZMA_OBJS) -lm
+ ln -s $(DYNAMICLIB) $(SONAME)
+ ln -s $(DYNAMICLIB) $(LIBNAME)
+
+ %.o: %.c
+- $(CC) $(CFLAGS) $<
++ $(CC) $(CPPFLAGS) $(CFLAGS) $(INCDEF) $<
+
+ %.o: $(LZMADIR)/%.c
+- $(CC) $(CFLAGS_LZMA) $<
++ $(CC) $(CPPFLAGS) $(CFLAGS) $(INCDEF_LZMA) $<
+
+ depend:
+ $(DEPEND) $(SRCS) $(LZMA_SRCS) > make.depend
+--- a/tools/Makefile.linux
++++ b/tools/Makefile.linux
+@@ -29,8 +29,7 @@
+ GLEWDIR = /usr/include/GL
+ RPLYDIR = rply
+
+-CPP = g++
+-CPPFLAGS = -c -O3 -W -Wall `pkg-config --cflags gtk+-2.0` -I$(OPENCTMDIR) -I$(RPLYDIR) -I$(GLEWDIR)
++CXXFLAGS += -W -Wall `pkg-config --cflags gtk+-2.0` -I$(OPENCTMDIR) -I$(RPLYDIR) -I$(GLEWDIR)
+
+ MESHOBJS = mesh.o meshio.o ctm.o ply.o rply.o stl.o 3ds.o dae.o obj.o lwo.o off.o wrl.o
+ CTMCONVOBJS = ctmconv.o common.o systimer.o convoptions.o $(MESHOBJS)
+@@ -43,18 +42,18 @@
+ rm -f ctmconv ctmviewer ctmbench $(CTMCONVOBJS) $(CTMVIEWEROBJS) $(CTMBENCHOBJS) bin2c phong_frag.h phong_vert.h
+
+ ctmconv: $(CTMCONVOBJS)
+- $(CPP) -s -o $@ -L$(OPENCTMDIR) $(CTMCONVOBJS) -lopenctm -ltinyxml
++ $(CXX) $(LDFLAGS) -s -o $@ -L$(OPENCTMDIR) $(CTMCONVOBJS) -lopenctm -ltinyxml
+
+ ctmviewer: $(CTMVIEWEROBJS)
+- $(CPP) -s -o $@ -L$(OPENCTMDIR) $(CTMVIEWEROBJS) -lopenctm \
++ $(CXX) $(LDFLAGS) -s -o $@ -L$(OPENCTMDIR) $(CTMVIEWEROBJS) -lopenctm \
+ -ltinyxml -ljpeg -lpnglite -lz -lGL -lglut -lGLU -lGLEW \
+ -lgtk-x11-2.0 -lgobject-2.0 -lglib-2.0
+
+ ctmbench: $(CTMBENCHOBJS)
+- $(CPP) -s -o $@ -L$(OPENCTMDIR) $(CTMBENCHOBJS) -lopenctm
++ $(CXX) $(LDFLAGS) -s -o $@ -L$(OPENCTMDIR) $(CTMBENCHOBJS) -lopenctm
+
+ %.o: %.cpp
+- $(CPP) $(CPPFLAGS) -o $@ $<
++ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
+
+ ctmconv.o: ctmconv.cpp systimer.h convoptions.h mesh.h meshio.h
+ ctmviewer.o: ctmviewer.cpp common.h image.h systimer.h sysdialog.h mesh.h meshio.h phong_vert.h phong_frag.h icons/icon_open.h icons/icon_save.h icons/icon_help.h
+@@ -83,7 +82,7 @@
+ ./bin2c phong.frag phongFragSrc > $@
+
+ bin2c: bin2c.cpp
+- $(CPP) -Os -W -Wall -o $@ $<
++ $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -Os -W -Wall -o $@ $<
+
+ rply.o: $(RPLYDIR)/rply.c
+- gcc -c -O2 -W -I$(RPLYDIR) -o $@ $<
++ $(CC) $(CPPFLAGS) $(CFLAGS) -c -O2 -W -I$(RPLYDIR) -o $@ $<
diff --git a/media-libs/openctm/files/openctm-1.0.3-use-system-libs.patch b/media-libs/openctm/files/openctm-1.0.3-use-system-libs.patch
new file mode 100644
index 000000000000..e6d158c6c3b1
--- /dev/null
+++ b/media-libs/openctm/files/openctm-1.0.3-use-system-libs.patch
@@ -0,0 +1,81 @@
+--- a/tools/Makefile.linux
++++ b/tools/Makefile.linux
+@@ -26,39 +26,29 @@
+ ###############################################################################
+
+ OPENCTMDIR = ../lib
+-GLEWDIR = glew
+-JPEGDIR = jpeg
++GLEWDIR = /usr/include/GL
+ RPLYDIR = rply
+-TINYXMLDIR = tinyxml
+-ZLIBDIR = zlib
+-PNGLITEDIR = pnglite
+
+ CPP = g++
+-CPPFLAGS = -c -O3 -W -Wall `pkg-config --cflags gtk+-2.0` -I$(OPENCTMDIR) -I$(RPLYDIR) -I$(JPEGDIR) -I$(TINYXMLDIR) -I$(GLEWDIR) -I$(ZLIBDIR) -I$(PNGLITEDIR)
++CPPFLAGS = -c -O3 -W -Wall `pkg-config --cflags gtk+-2.0` -I$(OPENCTMDIR) -I$(RPLYDIR) -I$(GLEWDIR)
+
+ MESHOBJS = mesh.o meshio.o ctm.o ply.o rply.o stl.o 3ds.o dae.o obj.o lwo.o off.o wrl.o
+ CTMCONVOBJS = ctmconv.o common.o systimer.o convoptions.o $(MESHOBJS)
+-CTMVIEWEROBJS = ctmviewer.o common.o image.o systimer.o sysdialog_gtk.o convoptions.o glew.o pnglite.o $(MESHOBJS)
+-CTMBENCHOBJS = ctmbench.o systimer.o
++CTMVIEWEROBJS = ctmviewer.o common.o image.o systimer.o sysdialog_gtk.o convoptions.o $(MESHOBJS)
++ CTMBENCHOBJS = ctmbench.o systimer.o
+
+ all: ctmconv ctmviewer ctmbench
+
+ clean:
+ rm -f ctmconv ctmviewer ctmbench $(CTMCONVOBJS) $(CTMVIEWEROBJS) $(CTMBENCHOBJS) bin2c phong_frag.h phong_vert.h
+- cd $(JPEGDIR) && $(MAKE) -f makefile.linux clean
+- cd $(TINYXMLDIR) && $(MAKE) -f Makefile.linux clean
+- cd $(ZLIBDIR) && $(MAKE) -f Makefile.linux clean
+
+-libopenctm.so: $(OPENCTMDIR)/libopenctm.so
+- cp $< $@
++ctmconv: $(CTMCONVOBJS)
++ $(CPP) -s -o $@ -L$(OPENCTMDIR) $(CTMCONVOBJS) -Wl,-rpath,. -lopenctm -ltinyxml
+
+-ctmconv: $(CTMCONVOBJS) $(TINYXMLDIR)/libtinyxml.a libopenctm.so
+- $(CPP) -s -o $@ -L$(OPENCTMDIR) -L$(TINYXMLDIR) $(CTMCONVOBJS) -Wl,-rpath,. -lopenctm -ltinyxml
++ctmviewer: $(CTMVIEWEROBJS)
++ $(CPP) -s -o $@ -L$(OPENCTMDIR) $(CTMVIEWEROBJS) -Wl,-rpath,. -lopenctm -ltinyxml -ljpeg -lpnglite -lz -lglut -lGLU -lGLEW `pkg-config --libs gtk+-2.0`
+
+-ctmviewer: $(CTMVIEWEROBJS) $(JPEGDIR)/libjpeg.a $(TINYXMLDIR)/libtinyxml.a $(ZLIBDIR)/libz.a libopenctm.so
+- $(CPP) -s -o $@ -L$(OPENCTMDIR) -L$(TINYXMLDIR) -L$(JPEGDIR) -L$(ZLIBDIR) $(CTMVIEWEROBJS) -Wl,-rpath,. -lopenctm -ltinyxml -ljpeg -lz -lglut -lGLU `pkg-config --libs gtk+-2.0`
+-
+-ctmbench: $(CTMBENCHOBJS) libopenctm.so
++ctmbench: $(CTMBENCHOBJS)
+ $(CPP) -s -o $@ -L$(OPENCTMDIR) $(CTMBENCHOBJS) -Wl,-rpath,. -lopenctm
+
+ %.o: %.cpp
+@@ -68,7 +58,7 @@
+ ctmviewer.o: ctmviewer.cpp common.h image.h systimer.h sysdialog.h mesh.h meshio.h phong_vert.h phong_frag.h icons/icon_open.h icons/icon_save.h icons/icon_help.h
+ ctmbench.o: ctmbench.cpp systimer.h
+ common.o: common.cpp common.h
+-image.o: image.cpp image.h common.h $(JPEGDIR)/libjpeg.a
++image.o: image.cpp image.h common.h
+ systimer.o: systimer.cpp systimer.h
+ sysdialog_gtk.o: sysdialog_gtk.cpp sysdialog.h
+ convoptions.o: convoptions.cpp convoptions.h
+@@ -93,20 +83,5 @@
+ bin2c: bin2c.cpp
+ $(CPP) -Os -W -Wall -o $@ $<
+
+-$(JPEGDIR)/libjpeg.a:
+- cd $(JPEGDIR) && $(MAKE) -f makefile.linux libjpeg.a
+-
+-$(ZLIBDIR)/libz.a:
+- cd $(ZLIBDIR) && $(MAKE) -f Makefile.linux
+-
+-glew.o: $(GLEWDIR)/glew.c
+- gcc -c -Os -W -I$(GLEWDIR) -o $@ $<
+-
+ rply.o: $(RPLYDIR)/rply.c
+ gcc -c -O2 -W -I$(RPLYDIR) -o $@ $<
+-
+-pnglite.o: $(PNGLITEDIR)/pnglite.c
+- gcc -c -O2 -W -I$(PNGLITEDIR) -o $@ $<
+-
+-$(TINYXMLDIR)/libtinyxml.a:
+- cd $(TINYXMLDIR) && $(MAKE) -f Makefile.linux
diff --git a/media-libs/openctm/metadata.xml b/media-libs/openctm/metadata.xml
index 2dcfe570b108..770fe31ee810 100644
--- a/media-libs/openctm/metadata.xml
+++ b/media-libs/openctm/metadata.xml
@@ -8,6 +8,9 @@
<email>3dprint@gentoo.org</email>
<name>Gentoo 3D print</name>
</maintainer>
+ <slots>
+ <subslots>soname major version number</subslots>
+ </slots>
<longdescription>
OpenCTM - the Open Compressed Triangle Mesh file format - is a file format, a software library and a tool set for compression of 3D triangle meshes.
</longdescription>
diff --git a/media-libs/openctm/openctm-1.0.3-r1.ebuild b/media-libs/openctm/openctm-1.0.3-r1.ebuild
new file mode 100644
index 000000000000..60585930f8ea
--- /dev/null
+++ b/media-libs/openctm/openctm-1.0.3-r1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit eutils multilib flag-o-matic toolchain-funcs
+
+MY_P=OpenCTM-${PV}
+
+DESCRIPTION="OpenCTM - the Open Compressed Triangle Mesh."
+HOMEPAGE="http://openctm.sourceforge.net"
+SRC_URI="https://downloads.sourceforge.net/project/openctm/${MY_P}/${MY_P}-src.tar.bz2 -> ${P}-src.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0/1"
+KEYWORDS="~amd64 ~x86"
+
+IUSE=""
+DEPEND="
+ dev-libs/tinyxml
+ media-libs/glew:0=
+ media-libs/pnglite
+ sys-libs/zlib
+ virtual/jpeg:0
+ media-libs/freeglut
+ virtual/opengl
+ x11-libs/gtk+:2"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-escape-hyphens-in-ctmconv-man-page.patch"
+ "${FILESDIR}/${P}-link-ctmviewer-with-libGLU.patch"
+ "${FILESDIR}/${P}-use-system-libs.patch"
+ "${FILESDIR}/${P}-do-not-set-rpath.patch"
+ "${FILESDIR}/${P}-link-ctmviewer-only-with-necessary-gtk-libs.patch"
+ "${FILESDIR}/${P}-link-ctmviewer-with-libGL.patch"
+ "${FILESDIR}/${P}-create-lib-with-correct-soname-and-symlinks.patch"
+ "${FILESDIR}/${P}-fix-install-paths.patch"
+ "${FILESDIR}/${P}-respect-flags.patch"
+ "${FILESDIR}/${P}-no-strip.patch"
+)
+
+src_prepare() {
+ edos2unix lib/Makefile.linux
+
+ default
+}
+
+src_compile() {
+ emake CC=$(tc-getCC) CXX="$(tc-getCXX)" -f Makefile.linux
+}
+
+src_install() {
+ emake DESTDIR="${ED}" LIBDIR="${ED}/usr/$(get_libdir)" -f Makefile.linux install
+}