Git Product home page Git Product logo

Comments (10)

rockowitz avatar rockowitz commented on June 16, 2024

from ddcutil.

dracwyrm avatar dracwyrm commented on June 16, 2024

Hi,

The auto files are regenerated each time a build is run. Even re-extracting the files so it's a 100% clean build from scratch. Sometimes the // happens because the variable is defined with ending in a slash and the path is set to begin with a slash, so when the two are concatenated together, the double slash happens. The variable for the path to install dir (/var/tmp/portage/app-misc/ddcutil-0.7.0/image/) ends in the slash, and the way the install dir in the makefiles might begin with / for /usr/lib.

However, I think I found the issue:
In the compile output there is this:

(install-exec-hook) Executing...
  pythondir       = /usr/lib64/python3.5/site-packages
  pyexecdir       = /usr/lib64/python3.5/site-packages
/var/tmp/portage/app-misc/ddcutil-0.7.0/image//usr/lib64
ls -ld /var/tmp/portage/app-misc/ddcutil-0.7.0/image//usr/lib64
ls: cannot access '/var/tmp/portage/app-misc/ddcutil-0.7.0/image//usr/lib64': No such file or directory

I looked for that in the make files. In "src/Makefile.am" there is this at the very bottom:

install-exec-hook:
	@echo "(install-exec-hook) Executing..." 
	@echo "  pythondir       = $(pythondir)"
	@echo "  pyexecdir       = $(pyexecdir)"
	@echo  $(DESTDIR)$(libdir)
	ls -ld $(DESTDIR)$(libdir)
	ls -l $(DESTDIR)$(libdir)/*la
	sed -i "/dependency_libs/ s/'.*'/''/" $(DESTDIR)$(libdir)/libddcutil.la

When there are no shared libs, I'm guess there are no libs installed to /usr/lib{32,64}, so this section should not be executed at all. It is trying to access a directory that doesn't exist, and then it will try to list files that don't exists and then it will try to sed a file that doesn't exist.

Hope this helps.

from ddcutil.

rockowitz avatar rockowitz commented on June 16, 2024

from ddcutil.

dracwyrm avatar dracwyrm commented on June 16, 2024

Sanford,

The test needs to detect the directory because it's also trying to use ls command in a directory that doesn't exist, which is the error:

ls: cannot access '/var/tmp/portage/app-misc/ddcutil-0.7.0/image//usr/lib64': No such file or directory

because that directory doesn't exist at all when using --disable-lib

I tried this patch:

diff -purN a/src/Makefile.am b/src/Makefile.am
--- a/src/Makefile.am	2017-01-02 21:42:04.000000000 +0000
+++ b/src/Makefile.am	2017-01-20 12:28:35.192559062 +0000
@@ -366,10 +366,12 @@ install-exec-hook:
 	@echo "(install-exec-hook) Executing..." 
 	@echo "  pythondir       = $(pythondir)"
 	@echo "  pyexecdir       = $(pyexecdir)"
-	@echo  $(DESTDIR)$(libdir)
-	ls -ld $(DESTDIR)$(libdir)
-	ls -l $(DESTDIR)$(libdir)/*la
-	sed -i "/dependency_libs/ s/'.*'/''/" $(DESTDIR)$(libdir)/libddcutil.la
+	if [[ -d $(DESTDIR)$(libdir) ]]; then \
+		@echo  $(DESTDIR)$(libdir) \
+		ls -ld $(DESTDIR)$(libdir) \
+		ls -l $(DESTDIR)$(libdir)/*la \
+		sed -i "/dependency_libs/ s/'.*'/''/" $(DESTDIR)$(libdir)/libddcutil.la \
+	fi
 
 # objdump -p $(DESTDIR)$(libdir)/libddcutil.so | sed -n -e's/^[[:space:]]*SONAME[[:space:]]*//p' |  sed -r -e's/([0-9])\.so\./\1-/; s/\.so(\.|$)//; y/_/-/; s/(.*)/\L&/'
 

But I get: /bin/sh: -c: line 6: syntax error: unexpected end of file
I tried in various forms of this after reading help on how to do directory checking in a makefile.

Cheers.

from ddcutil.

dracwyrm avatar dracwyrm commented on June 16, 2024

I did a bit more testing. I was able to compile ddcutil with lib disabled. However, there are some things that are installed that shouldn't be.

ddcutil.pc file is installed pointing to include and libs, but the libs are not installed:

ddcutil.pc:
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=${prefix}/include

Name: ddcutil
Description: Control display settings
URL: http://www.ddcutil.com
Version: 0.7.0
# Requires:  ??
# Libs and Cflags not needed since using default locations
Libs: -L${libdir} 
Cflags: -I${includedir}

Also, the header files are installed: /usr/include/{ddcutil_c_api.h,ddcutil_types.h} which mention that it's for the C API, however, the C API needed the shared libs that are not installed. Thus, the header files should not be installed as well.

There must be a better way of doing the patch as when I run compile, this is outputted:

(install-exec-hook) Executing...
  pythondir       = /usr/lib64/python3.5/site-packages
  pyexecdir       = /usr/lib64/python3.5/site-packages
if [[ -d /var/tmp/portage/app-misc/ddcutil-0.7.0/image//usr/lib64 ]]; then \
        @echo  /var/tmp/portage/app-misc/ddcutil-0.7.0/image//usr/lib64; \
        ls -ld /var/tmp/portage/app-misc/ddcutil-0.7.0/image//usr/lib64; \
        ls -l /var/tmp/portage/app-misc/ddcutil-0.7.0/image//usr/lib64/*la; \
        sed -i "/dependency_libs/ s/'.*'/''/" /var/tmp/portage/app-misc/ddcutil-0.7.0/image//usr/lib64/libddcutil.la; \
fi

So it doesn't make a very clean build log.

This is the patch I used:

diff -purN a/src/Makefile.am b/src/Makefile.am
--- a/src/Makefile.am	2017-01-02 21:42:04.000000000 +0000
+++ b/src/Makefile.am	2017-01-20 12:28:35.192559062 +0000
@@ -366,10 +366,12 @@ install-exec-hook:
 	@echo "(install-exec-hook) Executing..." 
 	@echo "  pythondir       = $(pythondir)"
 	@echo "  pyexecdir       = $(pyexecdir)"
-	@echo  $(DESTDIR)$(libdir)
-	ls -ld $(DESTDIR)$(libdir)
-	ls -l $(DESTDIR)$(libdir)/*la
-	sed -i "/dependency_libs/ s/'.*'/''/" $(DESTDIR)$(libdir)/libddcutil.la
+	if [[ -d $(DESTDIR)$(libdir) ]]; then \
+		@echo  $(DESTDIR)$(libdir); \
+		ls -ld $(DESTDIR)$(libdir); \
+		ls -l $(DESTDIR)$(libdir)/*la; \
+		sed -i "/dependency_libs/ s/'.*'/''/" $(DESTDIR)$(libdir)/libddcutil.la; \
+	fi
 
 # objdump -p $(DESTDIR)$(libdir)/libddcutil.so | sed -n -e's/^[[:space:]]*SONAME[[:space:]]*//p' |  sed -r -e's/([0-9])\.so\./\1-/; s/\.so(\.|$)//; y/_/-/; s/(.*)/\L&/'
 

Hope this helps.

from ddcutil.

rockowitz avatar rockowitz commented on June 16, 2024

from ddcutil.

dracwyrm avatar dracwyrm commented on June 16, 2024

Ah. The python trap.

Gentoo is nice because there are variables that store everything for building. It doesn't matter what the system has, as in, /usr/bin/python pointing to python35 or python27. When we build something, we give the configure script all the paths. For example, a user can want the program for python 2.7 even though 3.5 is default, so the path to 2.7 and the site-directory, includes... so on are passed through to the configure script and it installs everything for the right version of python and the right locations. :) (https://devmanual.gentoo.org/eclass-reference/python-utils-r1.eclass/index.html If you want to see how we sort it all).

All you need are variables that hold python version, site directories, library, includes, so on, set sane defaults and if they are different, then they can be overridden by package maintainers. That will save you a load of headaches as you only need to know your system, and set the defaults to that.

Cheers.

from ddcutil.

rockowitz avatar rockowitz commented on June 16, 2024

from ddcutil.

dracwyrm avatar dracwyrm commented on June 16, 2024

Thanks for your hard work on this. :)

from ddcutil.

dracwyrm avatar dracwyrm commented on June 16, 2024

0.7.1 compiles perfectly with or without shared libs enabled. Thanks for your hard work on fixing this.

Jon

from ddcutil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.