Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#51737 closed submission (fixed)

New port libpointing

Reported by: izzatbek@… Owned by: ryandesign (Ryan Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: kurthindenburg (Kurt Hindenburg), g5pw (Aljaž Srebrnič), izzatbek@…, raimue (Rainer Müller)
Port: libpointing


Libpointing is an open-source cross-platform library written in C++ that provides direct access to HID pointing devices and supports the design of pointing transfer functions.

Attachments (2)

Portfile (1.1 KB) - added by izzatbek@… 5 years ago.
Added PortGroup
Portfile.2 (1.1 KB) - added by izzatbek@… 5 years ago.

Download all attachments as: .zip

Change History (20)

comment:1 Changed 5 years ago by mf2k (Frank Schima)

Cc: izzatbek@… removed
Keywords: HID pointing transfer-function removed

Thanks. As reporter, you do not need to Cc yourself.

comment:2 Changed 5 years ago by ryandesign (Ryan Schmidt)

Because this downloads from github, you should use the github portgroup.

Changed 5 years ago by izzatbek@…

Attachment: Portfile added

Added PortGroup

comment:3 Changed 5 years ago by izzatbek@…

Any news?

comment:4 Changed 5 years ago by kurthindenburg (Kurt Hindenburg)

Cc: khindenburg@… added

Does this Portfile actually build/install for you? I think it will require a lot of work to get it work

comment:5 Changed 5 years ago by izzatbek@…

In fact, this Portfile downloads the archive with a Makefile which can build and install libpointing (I used the same archive for homebrew). We have already released a few versions of libpointing. Normally, it works fine

comment:6 Changed 5 years ago by izzatbek@…

Any news? What's wrong with the Portfile? Can you please verify it?

comment:7 in reply to:  6 Changed 5 years ago by g5pw (Aljaž Srebrnič)

Replying to izzatbek@…:

Any news? What's wrong with the Portfile? Can you please verify it?

A couple of things are wrong.

  • we require at least two checksums (current defaults are sha256 and rmd160)
  • The distname you set is the default one, so that line can be omitted
  • I see you set use_configure no. You need to be sure that the portfile is UsingTheRightCompiler
  • I see you specify the github PortGroup, but I don't see a call to github.setup. That's why you had to set up master_sites. Refer to the PortGroup file for usage.

comment:8 Changed 5 years ago by g5pw (Aljaž Srebrnič)

Cc: g5pw@… added

Cc Me!

Changed 5 years ago by izzatbek@…

Attachment: Portfile.2 added

comment:9 Changed 5 years ago by izzatbek@…

Cc: izzatbek@… added

Cc Me!

comment:10 Changed 5 years ago by izzatbek@…

Thanks for your reply,

  • So, I added rmd160 checksum and removed distname.
  • To use the right compiler can I just use compiler.whitelist or I need to specify differently? In the Makefile (from downloaded archive) I specify g++.
  • I removed github PortGroup, since I do not build from github repo directly, but for the releases output by Travis CI.

Waiting from you

Last edited 5 years ago by izzatbek@… (previous) (diff)

comment:11 Changed 5 years ago by kenneth.f.cunningham@…

I just took a look at this, on MacOSX Snow Leopard with libc++ installed. After putting the Portfile into my local repository, the initial build went like this:

$ sudo port -v build libpointing
--->  Computing dependencies for libpointing.
--->  Building libpointing
make: Entering directory `/opt/local/var/macports/build/_opt_myports_devel_libpointing/libpointing/work/libpointing-0.9.7'
make: *** No rule to make target `all'.  Stop.
make: Leaving directory `/opt/local/var/macports/build/_opt_myports_devel_libpointing/libpointing/work/libpointing-0.9.7'
Command failed:  cd "/opt/local/var/macports/build/_opt_myports_devel_libpointing/libpointing/work/libpointing-0.9.7" && /usr/bin/make -j2 -w all 

Going into the directory directly, I could start the build with "make". But this failed with

$ make
g++ -stdlib=libc++ -mmacosx-version-min=10.6 -std=c++11 -Iinclude -DPOINTING_XORG  -c -o src/pointing/utils/Base64.o src/pointing/utils/Base64.cpp
cc1plus: error: unrecognized command line option "-stdlib=libc++"
cc1plus: error: unrecognized command line option "-std=c++11"
make: *** [src/pointing/utils/Base64.o] Error 1

Editing the Makefile directly, I changed the compiler to clang++ and the -mmacosx-version-min to 10.6. The build then went better, until:

In file included from src/pointing/input/osx/osxPrivateMultitouchDevice.cpp:16:
In file included from include/pointing/input/osx/osxPrivateMultitouchDevice.h:20:
include/pointing/input/osx/osxPrivateMultitouchSupport.h:93:40: error: unknown type name 'uuid_t'
    MTDeviceRef MTDeviceCreateFromGUID(uuid_t *guid) ; // FIXME: doesn't work with MTDeviceGetGUID...

and this was fixed with adding the following to pointing/input/osx/osxPrivateMultitouchSupport.h

#include <unistd.h>

After that, the build proceeded successfully (using "make"), and the product, was produced.

-rwxr-xr-x  1 root      admin  664904 12 Aug 13:00 libpointing.dylib

The test produced the following, which I presume to be the correct output?

KensMacBookPro:libpointing-0.9.7 cunningh$ sudo make test
clang++ -stdlib=libc++ -Iinclude -DPOINTING_XORG -mmacosx-version-min=10.6 -std=c++11 -o src/simpletest src/simpletest.cpp -Llib -F/System/Library/PrivateFrameworks -mmacosx-version-min=10.6 -framework MultitouchSupport -framework IOKit -framework CoreFoundation -framework ApplicationServices -framework AppKit -lpointing
0.9.7 | system xorg subpixel constant interpolation naive sigmoid composition

SO - it seems there is no rule for "make all", the compiler should be clang++, the macos-min-version can be 10.6 if 10.6 has libc++ is installed, and there needs to be a reference to the missing #include in the noted file, at least on this system.

I hope this helps!


comment:12 Changed 5 years ago by kenneth.f.cunningham@…

Whoops. One more thing to fix. With "sudo make install" everything was installed into /usr/local, instead of the macports directory:

$ sudo make install
mkdir -p /usr/local/include
cp -r include/pointing /usr/local/include
cp -r include/pointing-xorg /usr/local/include
cp -r include/pointing-echomouse /usr/local/include
mkdir -p /usr/local/lib
cp -r lib /usr/local

comment:13 Changed 5 years ago by izzatbek@…

Thanks for the feedback!

So, I should use macon-min-version = 10.6. Can't I just restrict it to be 10.7? How can I detect if libc++ is installed?

Also, I thought PREFIX in the makefile should install everything correctly in the correct directory. What should I use instead?

Thank you in advance, Izzat

comment:14 Changed 5 years ago by raimue (Rainer Müller)

Cc: raimue@… added

You should still use PortGroup github, that simplifies the Portfile and you can omit explicit name, version, and master_sites. The homepage is just a redirect to GitHub, so I would remove that as well.

PortGroup github 1.0

github.setup INRIA libpointing 1.0.1 v
github.tarball_from releases

According to the, the license is actually GPL-2+.

Do not use compiled binaries from Travis. Redistributing compiled binaries is discouraged and the Portfile should compile from source. Our buildbot infrastructure will produce binaries for different releases of OS X.

This project seems to be using qmake as build system, so you should add the following port group to the top of the file and remove the wrong statement use_configure no:

PortGroup qmake 1.0

comment:15 Changed 5 years ago by ryandesign (Ryan Schmidt)

Owner: changed from macports-tickets@… to ryandesign@…
Status: newassigned

comment:16 Changed 5 years ago by ryandesign (Ryan Schmidt)

I've spent a little time looking at this now.

The source code in GitHub indeed uses QMake as a configuration system. I can download that code and run qmake && make and it looks like a bunch of object files get compiled but no Mac library, and make install does nothing.

But then you have building-and-packaging/mac/prepare which is a Python script that creates a whole different source distribution file for macOS including a new dynamically-generated Makefile which hardcodes the compiler as g++; overwrites CPPFLAGS, CXXFLAGS and LDFLAGS so I can't specify them at the command line; doesn't set the library's install_name or compatibility_version or current_version when compiling it; and has an install target that doesn't support DESTDIR and uses the deprecated -r flag of the cp command. This distribution file is what you have uploaded to GitHub Releases as libpointing-mac-1.0.1.tar.gz and are using in the Portfile you submitted here.

Why have you made it so confusing and convoluted? Why does macOS need a separate distribution file and build system? Why not simply let me download the source code from your repository and run ./configure && make && sudo make install which so many other projects successfully use?

comment:17 Changed 5 years ago by ryandesign (Ryan Schmidt)

Resolution: fixed
Status: assignedclosed

I've added the port in r152635. You should remove the Portfile you have in your GitHub repository, and remove the Portfiles from your GitHub releases.

comment:18 Changed 5 years ago by izzatbek@…

In fact, the procedure is complicated, since we didn't want to depend on qmake, so created those packaging scripts. And since I do not master building Makefiles, there were such inconsistencies. I saw what you have done. Thanks a lot.

Now what happens if I want to update the library? I need to update the Portfile? And possible the patch-file?

Note: See TracTickets for help on using tickets.