Ticket #46029: patch-for-macports-linux.diff

File patch-for-macports-linux.diff, 6.9 KB (added by RJVB (René Bertin), 9 years ago)

indeed, I've managed to install my own port:qt5-kde under Linux...

  • Makefile

    diff --git a/Makefile b/Makefile
    index 2e7f814..ec597f1 100644
    a b  
    11MKDIR  = mkdir -p
    2 prefix = /usr
     2prefix = @PREFIX@
    33bindir = $(prefix)/bin
    44TOOLS = assistant \
    55        designer \
    distclean: 
    6060
    6161install:
    6262        cd src/qtchooser && $(MAKE) install
    63         for tool in $(TOOLS); do ln -sf qtchooser "$(INSTALL_ROOT)$(bindir)/$$tool"; done
     63        for tool in $(TOOLS); do ln -sf qtchooser-mp "$(DESTDIR)$(bindir)/$$tool"; done
    6464        case `uname -s` in Darwin) \
    65             for tool in $(MACTOOLS); do ln -sf qtchooser "$(INSTALL_ROOT)$(bindir)/$$tool"; done \
     65            for tool in $(MACTOOLS); do ln -sf qtchooser-mp "$(DESTDIR)$(bindir)/$$tool"; done \
    6666        ;; esac
    67         $(MKDIR) $(INSTALL_ROOT)$(prefix)/share/man/man1
    68         install -m 644 -p doc/qtchooser.1 $(INSTALL_ROOT)$(prefix)/share/man/man1
     67        $(MKDIR) $(DESTDIR)$(prefix)/share/man/man1
     68        install -m 644 -p doc/qtchooser.1 $(DESTDIR)$(prefix)/share/man/man1/qtchooser-mp.1
    6969
    7070uninstall:
    7171        cd src/qtchooser && $(MAKE) uninstall
    72         -for tool in $(TOOLS); do rm -f "$(INSTALL_ROOT)$(bindir)/$$tool"; done
     72        -for tool in $(TOOLS); do rm -f "$(DESTDIR)$(bindir)/$$tool"; done
    7373        case `uname -s` in Darwin) \
    74             for tool in $(MACTOOLS); do rm -f "$(INSTALL_ROOT)$(bindir)/$$tool"; done \
     74            for tool in $(MACTOOLS); do rm -f "$(DESTDIR)$(bindir)/$$tool"; done \
    7575        ;; esac
    7676
    7777tests/auto/Makefile: tests/auto/auto.pro
  • src/qtchooser/Makefile

    diff --git a/src/qtchooser/Makefile b/src/qtchooser/Makefile
    index 6ad619a..2384ec4 100644
    a b  
    1 prefix = /usr
     1prefix = @PREFIX@
    22bindir = $(prefix)/bin
    33
    44####### Compiler, tools and options
    MKDIR = mkdir -p 
    1212
    1313SOURCES       = main.cpp
    1414OBJECTS       = main.o
    15 TARGET        = qtchooser
     15TARGET        = qtchooser-mp
    1616
    1717OBJECTS_TEST  = main-test.o
    1818TARGET_TEST   = test/qtchooser
    distclean: clean 
    4343        -$(DEL_FILE) $(TARGET) $(TARGET_TEST)
    4444
    4545install: $(TARGET)
    46         $(MKDIR) "$(INSTALL_ROOT)$(bindir)"
    47         $(INSTALL_PROGRAM) $(TARGET) "$(INSTALL_ROOT)$(bindir)/$(TARGET)"
     46        $(MKDIR) "$(DESTDIR)$(bindir)"
     47        $(INSTALL_PROGRAM) $(TARGET) "$(DESTDIR)$(bindir)/$(TARGET)"
    4848
    4949uninstall:
    50         -$(DEL_FILE) "$(INSTALL_ROOT)$(bindir)/$(TARGET)"
     50        -$(DEL_FILE) "$(DESTDIR)$(bindir)/$(TARGET)"
    5151
    5252
    5353####### Compile
  • src/qtchooser/main.cpp

    diff --git a/src/qtchooser/main.cpp b/src/qtchooser/main.cpp
    index d028ee6..3468f97 100644
    a b  
    8282
    8383using namespace std;
    8484
    85 static const char myName[] = "qtchooser" EXE_SUFFIX;
     85static const char myName[] = "qtchooser-mp" EXE_SUFFIX;
    8686static const char confSuffix[] = ".conf";
    8787
    8888static const char *argv0;
    private: 
    152152int ToolWrapper::printHelp()
    153153{
    154154    puts("Usage:\n"
    155          "  qtchooser { -l | -list-versions | -print-env }\n"
    156          "  qtchooser -install [-f] [-local] <name> <path-to-qmake>\n"
    157          "  qtchooser -run-tool=<tool name> [-qt=<Qt version>] [program arguments]\n"
     155         "  qtchooser-mp { -l | -list-versions | -print-env }\n"
     156         "  qtchooser-mp -install [-f] [-local] <name> <path-to-qmake>\n"
     157         "  qtchooser-mp -run-tool=<tool name> [-qt=<Qt version>] [program arguments]\n"
    158158         "  <executable name> [-qt=<Qt version>] [program arguments]\n"
    159159         "\n"
    160160         "Environment variables accepted:\n"
    vector<string> ToolWrapper::searchPaths() const 
    454454    paths.push_back(localDir);
    455455
    456456    // search the XDG config location directories
    457     vector<string> xdgPaths = stringSplit(qgetenv("XDG_CONFIG_DIRS", "/etc/xdg").c_str());
     457    vector<string> xdgPaths = stringSplit(qgetenv("XDG_MACPORTS_CONFIG_DIRS", "@PREFIX@/etc/xdg").c_str());
    458458    paths.insert(paths.end(), xdgPaths.begin(), xdgPaths.end());
    459459
    460460#if defined(QTCHOOSER_GLOBAL_DIR)
    vector<string> ToolWrapper::searchPaths() const 
    465465#endif
    466466
    467467    for (vector<string>::iterator it = paths.begin(); it != paths.end(); ++it)
    468         *it += "/qtchooser/";
     468        *it += "/qtchooser-mp/";
    469469
    470470    return paths;
    471471}
  • src/qtchooser/qtchooser.pro

    diff --git a/src/qtchooser/qtchooser.pro b/src/qtchooser/qtchooser.pro
    index 6037e5c..fce3942 100644
    a b TEMPLATE = app 
    22DESTDIR = ../../bin
    33CONFIG -= qt
    44SOURCES += main.cpp Makefile
     5TARGET = qtchooser-mp
    56
    67error("This .pro file is not meant to be used to build")
  • doc/qtchooser.1

    diff --git a/doc/qtchooser.1 b/doc/qtchooser.1
    index 4c9bb83..5e8572e 100644
    a b  
    11.TH QTCHOOSER 1 "JANUARY 2, 2013"
    22.\" Please adjust this date whenever revising the manpage.
    33.SH NAME
    4 qtchooser \- a wrapper used to select between Qt development binary versions
     4qtchooser-mp \- a wrapper used to select between Qt development binary versions
    55.SH SYNOPSIS
    6 .B qtchooser
     6.B qtchooser-mp
    77\fB\-list\-versions\fR
    88.br
    9 .B qtchooser
     9.B qtchooser-mp
    1010\fB\-print\-env\fR [\fB\-qt=\fIversion\fR]
    1111.br
    12 .B qtchooser
     12.B qtchooser-mp
    1313\fB\-run\-tool=\fItool\fR [\fB\-qt=\fIversion\fR] [\fIprogram_arguments\fR]
    1414.br
    1515.B <executable_name>
    or local Qt builds are to be used. 
    2626It is commonly used via a symlink from an \fIexecutable_name\fR like qmake.
    2727.SH OPTIONS
    2828The options which apply to the
    29 \fBqtchooser\fR
     29\fBqtchooser-mp\fR
    3030command are:
    3131.PP
    3232\fB\-list\-versions\fR
    Runs the selected \fItool\fR. 
    5151.SH ENVIRONMENT
    5252.TP
    5353.B QTCHOOSER_NO_GLOBAL_DIR
    54 If qtchooser has been built with \fBQTCHOOSER_GLOBAL_DIR\fR (predefined search
    55 paths for qtchooser's configuration files, useful in some distros), setting this
     54If qtchooser-mp has been built with \fBQTCHOOSER_GLOBAL_DIR\fR (predefined search
     55paths for qtchooser-mp's configuration files, useful in some distros), setting this
    5656variable will override its effect.
    5757.RE
    5858.TP
    5959.B QT_SELECT
    6060Same as \fB\-qt=\fIversion\fR. If set, the selected configuration is used and binaries
    61 symlinked to qtchooser will be executed without additional parameters.
     61symlinked to qtchooser-mp will be executed without additional parameters.
    6262.RE
    6363.TP
    6464.B XDG_CONFIG_HOME
    Used as specified in 
    6868<\fBhttp://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html\fR>
    6969.SH FILES
    7070.TP
    71 .I /etc/xdg/qtchooser/*.conf
     71.I <MacPorts prefix>/etc/xdg/qtchooser-mp/*.conf
    7272System-wide configuration files. Each has two lines, the first is the path
    7373to the binaries and the second is the path to the Qt libraries. If a
    7474\fIdefault.conf\fR is provided, the settings from it will be automatically
    75 used in case nothing else is selected.
     75used in case nothing else is selected. \fI<MacPorts prefix>\fR is the location
     76where you installed MacPorts, typically \fI/opt/local\fR.
    7677.TP
    77 .I \fB$HOME\fP/.config/qtchooser/*.conf
     78.I \fB$HOME\fP/.config/qtchooser-mp/*.conf
    7879User configuration files.
    7980
    8081.SH AUTHOR
    81 qtchooser was written by Thiago Macieira from Intel.
     82qtchooser-mp was written by Thiago Macieira from Intel.
    8283.PP
    8384This manual page was written by Timo Jyrinki <timo@debian.org>,
    8485for the Debian project (but may be used by others).