code:
Upstream: no (Too lazy)
Reason: Fixes building the package by getting rid of old cpp macros
 that are no longer accepted
diff --git a/src/g80_driver.c b/src/g80_driver.c
index 719b96c..3b8e55b 100644
--- a/src/g80_driver.c
+++ b/src/g80_driver.c
@@ -151,7 +151,7 @@ G80PreInit(ScrnInfoPtr pScrn, int flags)
 {
     G80Ptr pNv;
     EntityInfoPtr pEnt;
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     struct pci_device *pPci;
     int err;
     void *p;
@@ -184,14 +184,14 @@ G80PreInit(ScrnInfoPtr pScrn, int flags)
     pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
     if(pEnt->location.type != BUS_PCI) goto fail;
     pPci = xf86GetPciInfoForEntity(pEnt->index);
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     /* Need this to unmap */
     pNv->pPci = pPci;
 #endif
     primary = xf86IsPrimaryPci(pPci);

     /* The ROM size sometimes isn't read correctly, so fix it up here. */
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     if(pPci->rom_size == 0)
         /* The BIOS is 64k */
         pPci->rom_size = 64 * 1024;
@@ -304,7 +304,7 @@ G80PreInit(ScrnInfoPtr pScrn, int flags)
     pScrn->memPhysBase = MEMBASE(pPci, 1);
     pScrn->fbOffset = 0;

-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     err = pci_device_map_range(pPci, pPci->regions[0].base_addr, G80_REG_SIZE,
                                PCI_DEV_MAP_FLAG_WRITABLE, &p);
     if(err) {
@@ -336,7 +336,7 @@ G80PreInit(ScrnInfoPtr pScrn, int flags)

     /* Determine the size of BAR1 */
     /* Some configs have BAR1 < total RAM < 256 MB */
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     BAR1sizeKB = pPci->regions[1].size / 1024;
 #else
     BAR1sizeKB = 1UL << (pPci->size[1] - 10);
@@ -366,7 +366,7 @@ G80PreInit(ScrnInfoPtr pScrn, int flags)
     xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "  Mapped memory: %.1f MB\n",
                pScrn->videoRam / 1024.0);

-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     err = pci_device_map_range(pPci, pPci->regions[1].base_addr,
                                pScrn->videoRam * 1024,
                                PCI_DEV_MAP_FLAG_WRITABLE |
@@ -521,7 +521,7 @@ G80CloseScreen(CLOSE_SCREEN_ARGS_DECL)

     if(xf86ServerIsExiting()) {
         if(pNv->int10) xf86FreeInt10(pNv->int10);
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
         pci_device_unmap_range(pNv->pPci, pNv->mem, pNv->videoRam * 1024);
         pci_device_unmap_range(pNv->pPci, (void*)pNv->reg, G80_REG_SIZE);
 #else
diff --git a/src/g80_type.h b/src/g80_type.h
index f4b73a3..5b1f975 100644
--- a/src/g80_type.h
+++ b/src/g80_type.h
@@ -41,7 +41,7 @@ typedef enum AccelMethod {
 } AccelMethod;

 typedef struct G80Rec {
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     struct pci_device  *pPci;
 #endif
     volatile CARD32 *   reg;
diff --git a/src/nv_const.h b/src/nv_const.h
index 8f9799c..b0cc14f 100644
--- a/src/nv_const.h
+++ b/src/nv_const.h
@@ -6,7 +6,7 @@
 #define NV_DRIVER_NAME "nv"

 /* libpciaccess gratuitous API changes */
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
  #define MEMBASE(p,n)     (p)->regions[n].base_addr
  #define VENDOR_ID(p)     (p)->vendor_id
  #define DEVICE_ID(p)     (p)->device_id
diff --git a/src/nv_dac.c b/src/nv_dac.c
index 2269ae3..8d79ed8 100644
--- a/src/nv_dac.c
+++ b/src/nv_dac.c
@@ -42,7 +42,7 @@ NVDACPanelTweaks(NVPtr pNv, NVRegPtr state)
           we can do is experiment and apply hacks. */

        if(((pNv->Chipset & 0xffff) == 0x0328) && (state->bpp == 32)) {
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
           if (((pNv->PciInfo->subvendor_id & 0xffff) == 0x1179) &&
               ((pNv->PciInfo->subdevice_id & 0xffff) == 0x0020))
 #else
diff --git a/src/nv_driver.c b/src/nv_driver.c
index 3a74038..cf185f8 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -43,7 +43,7 @@ Bool    G80GetScrnInfoRec(PciChipsets *chips, int chip);
 /* Mandatory functions */
 static const OptionInfoRec * NVAvailableOptions(int chipid, int busid);
 static void    NVIdentify(int flags);
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
 static Bool    NVPciProbe(DriverPtr, int entity, struct pci_device*, intptr_t data);
 #else
 static Bool    NVProbe(DriverPtr drv, int flags);
@@ -76,7 +76,7 @@ static void	NVRestore(ScrnInfoPtr pScrn);
 static Bool	NVModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
 static Bool	NVSetModeVBE(ScrnInfoPtr pScrn, DisplayModePtr pMode);

-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
 /* For now, just match any NVIDIA display device and sort through them in the
  * probe routine */

@@ -109,7 +109,7 @@ _X_EXPORT DriverRec NV = {
         NV_VERSION,
 	NV_DRIVER_NAME,
         NVIdentify,
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
         NULL,
 #else
         NVProbe,
@@ -118,7 +118,7 @@ _X_EXPORT DriverRec NV = {
         NULL,
         0,
         NULL,
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
         NVPciIdMatchList,
         NVPciProbe,
 #endif
@@ -712,7 +712,7 @@ nvSetup(pointer module, pointer opts, int *errmaj, int *errmin)
     if (!setupDone) {
         setupDone = TRUE;
         xf86AddDriver(&NV, module,
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
             HaveDriverFuncs
 #else
             0
@@ -785,14 +785,14 @@ NVGetScrnInfoRec(PciChipsets *chips, int chip)

 static CARD32
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
 NVGetPCIXpressChip (struct pci_device *dev)
 #else
 NVGetPCIXpressChip (pciVideoPtr pVideo)
 #endif
 {
     volatile CARD32 *regs;
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     uint32_t pciid, pcicmd;
     void *tmp;

@@ -902,7 +902,7 @@ NVIsSupported(CARD32 id)
 }

 /* Mandatory */
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
 static Bool
 NVPciProbe(DriverPtr drv, int entity, struct pci_device *dev, intptr_t data)
 {
@@ -2097,7 +2097,7 @@ NVMapMem(ScrnInfoPtr pScrn)
 {
     NVPtr pNv = NVPTR(pScrn);

-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     void *tmp;

     pci_device_map_range(pNv->PciInfo, pNv->FbAddress, pNv->FbMapSize,
@@ -2144,7 +2144,7 @@ NVUnmapMem(ScrnInfoPtr pScrn)

     pNv = NVPTR(pScrn);

-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     pci_device_unmap_range(pNv->PciInfo, pNv->FbBase, pNv->FbMapSize);
 #else
     xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pNv->FbBase, pNv->FbMapSize);
diff --git a/src/nv_hw.c b/src/nv_hw.c
index 9291912..90c7ac7 100644
--- a/src/nv_hw.c
+++ b/src/nv_hw.c
@@ -653,7 +653,7 @@ static void nv30UpdateArbitrationSettings (
     *lwm = graphics_lwm >> 3;
 }

-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
 static inline uint32_t
 pciaccessReadLong(struct pci_device *const dev, pciaddr_t offset) {
     uint32_t tmp;
@@ -670,7 +670,7 @@ static void nForceUpdateArbitrationSettings (
     NVPtr        pNv
 )
 {
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     struct pci_device *const dev1 = pci_device_find_by_slot(0, 0, 0, 1);
     struct pci_device *const dev2 = pci_device_find_by_slot(0, 0, 0, 2);
     struct pci_device *const dev3 = pci_device_find_by_slot(0, 0, 0, 3);
diff --git a/src/nv_setup.c b/src/nv_setup.c
index 92ca3ec..8c57675 100644
--- a/src/nv_setup.c
+++ b/src/nv_setup.c
@@ -287,7 +287,7 @@ static void nv10GetConfig (NVPtr pNv)
     }
 #endif

-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     {
     /* [AGP]: I don't know if this is correct */
     struct pci_device *dev = pci_device_find_by_slot(0, 0, 0, 1);
@@ -346,7 +346,7 @@ NVCommonSetup(ScrnInfoPtr pScrn)
     int FlatPanel = -1;   /* really means the CRTC is slaved */
     Bool Television = FALSE;
     void *tmp;
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     int err;
 #endif

@@ -378,7 +378,7 @@ NVCommonSetup(ScrnInfoPtr pScrn)
     pVga->MMIOBase   = (CARD8 *)pNv;
     pVga->MMIOOffset = 0;

-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     err = pci_device_map_range(pNv->PciInfo, pNv->IOAddress, 0x01000000,
 			       PCI_DEV_MAP_FLAG_WRITABLE, &tmp);
     if (err != 0) {
diff --git a/src/nv_type.h b/src/nv_type.h
index e705d4c..68ca210 100644
--- a/src/nv_type.h
+++ b/src/nv_type.h
@@ -78,7 +78,7 @@ typedef struct {
     CARD32              Architecture;
     CARD32              CursorStart;
     EntityInfoPtr       pEnt;
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     struct pci_device  *PciInfo;
 #else
     pciVideoPtr         PciInfo;
diff --git a/src/riva_driver.c b/src/riva_driver.c
index 759501e..910e63d 100644
--- a/src/riva_driver.c
+++ b/src/riva_driver.c
@@ -825,7 +825,7 @@ RivaMapMem(ScrnInfoPtr pScrn)
     /*
      * Map IO registers to virtual address space
      */
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     void *tmp;

     pci_device_map_range(pRiva->PciInfo, pRiva->IOAddress, 0x1000000,
@@ -890,7 +890,7 @@ RivaUnmapMem(ScrnInfoPtr pScrn)
     /*
      * Unmap IO registers to virtual address space
      */
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     pci_device_unmap_range(pRiva->PciInfo, pRiva->IOBase, 0x1000000);
     pci_device_unmap_range(pRiva->PciInfo, pRiva->FbBase, pRiva->FbMapSize);
 #else
diff --git a/src/riva_setup.c b/src/riva_setup.c
index 533f6e8..602e6dc 100644
--- a/src/riva_setup.c
+++ b/src/riva_setup.c
@@ -233,7 +233,7 @@ Riva3Setup(ScrnInfoPtr pScrn)
     pRiva->riva.EnableIRQ = 0;
     pRiva->riva.IO      = VGA_IOBASE_COLOR;

-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
 #define MAP(ptr, offset, size) { \
     void *tmp; \
     pci_device_map_range(pRiva->PciInfo, (offset), (size), \
diff --git a/src/riva_type.h b/src/riva_type.h
index 4adeb2b..ee999c8 100644
--- a/src/riva_type.h
+++ b/src/riva_type.h
@@ -53,7 +53,7 @@ typedef struct {
     RIVA_HW_STATE       SavedReg;
     RIVA_HW_STATE       ModeReg;
     EntityInfoPtr       pEnt;
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     struct pci_device  *PciInfo;
 #else
     pciVideoPtr         PciInfo;
diff --git a/src/nv_driver.c b/src/nv_driver.c
index cf185f8..d35af55 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -766,7 +766,7 @@ NVGetScrnInfoRec(PciChipsets *chips, int chip)
     pScrn->driverName       = NV_DRIVER_NAME;
     pScrn->name             = NV_NAME;

-#if !XSERVER_LIBPCIACCESS
+#ifndef XSERVER_LIBPCIACCESS
     pScrn->Probe            = NVProbe;
 #endif
     pScrn->PreInit          = NVPreInit;
@@ -1390,7 +1390,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)

     /* Find the PCI info for this screen */
     pNv->PciInfo = xf86GetPciInfoForEntity(pNv->pEnt->index);
-#if !XSERVER_LIBPCIACCESS
+#ifndef XSERVER_LIBPCIACCESS
     pNv->PciTag = pciTag(pNv->PciInfo->bus, pNv->PciInfo->device,
 			  pNv->PciInfo->func);
 #endif
diff --git a/src/riva_driver.c b/src/riva_driver.c
index 910e63d..a365380 100644
--- a/src/riva_driver.c
+++ b/src/riva_driver.c
@@ -385,7 +385,7 @@ RivaPreInit(ScrnInfoPtr pScrn, int flags)

     /* Find the PCI info for this screen */
     pRiva->PciInfo = xf86GetPciInfoForEntity(pRiva->pEnt->index);
-#if !XSERVER_LIBPCIACCESS
+#ifndef XSERVER_LIBPCIACCESS
     pRiva->PciTag = pciTag(pRiva->PciInfo->bus, pRiva->PciInfo->device,
 			  pRiva->PciInfo->func);
 #endif


code:
$NetBSD: patch-src_s3v__driver.c,v 1.3 2018/05/20 07:32:50 wiz Exp $

Fix build with modular-xorg-server-1.20.

--- src/s3v_driver.c.orig	2015-09-26 16:28:11.000000000 +0000
+++ src/s3v_driver.c
@@ -1203,6 +1203,7 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags)
    vga256InfoRec.directMode = XF86DGADirectPresent;
 #endif

+#if 0
     /*
      * xf86ValidateModes will check that the mode HTotal and VTotal values
      * don't exceed the chipset's limit if pScrn->maxHValue and
@@ -1214,6 +1215,7 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags)
 			 	/* true for all ViRGE? */
   pScrn->maxHValue = 2048;
   pScrn->maxVValue = 2048;
+#endif

     				/* Lower depths default to config file */
   pScrn->virtualX = pScrn->display->virtualX;

repo_name: dustdfg/dragora

license: mit


code:
$NetBSD: patch-src_savage__driver.c,v 1.3 2018/05/20 07:30:09 wiz Exp $

Fix build with modular-xorg-server-1.20

--- src/savage_driver.c.orig	2017-01-17 22:43:40.000000000 +0000
+++ src/savage_driver.c
@@ -2034,8 +2034,10 @@ static Bool SavagePreInit(ScrnInfoPtr pS
     xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected current MCLK value of %1.3f MHz\n",
 	       mclk / 1000.0);

+#if 0
     pScrn->maxHValue = 2048 << 3;	/* 11 bits of h_total 8-pixel units */
     pScrn->maxVValue = 2048;		/* 11 bits of v_total */
+#endif
     pScrn->virtualX = pScrn->display->virtualX;
     pScrn->virtualY = pScrn->display->virtualY;


code:
Upstream: no (Too lazy)
Reason: Fixes build with new GCC by fixing old CPP macros
diff --git a/src/sis_driver.c b/src/sis_driver.c
index 51c9660..5e2eba2 100644
--- a/src/sis_driver.c
+++ b/src/sis_driver.c
@@ -4166,7 +4166,7 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
 			      biossize = 0x8000;
 			      break;
 	     }
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
 	     if(readpci) {
 		pSiS->PciInfo->rom_size = biossize;
 		pci_device_read_rom(pSiS->PciInfo, pSiS->BIOS);
diff --git a/src/sis_vga.c b/src/sis_vga.c
index 8b625d2..c40c140 100644
--- a/src/sis_vga.c
+++ b/src/sis_vga.c
@@ -1715,7 +1715,7 @@ SiSVGAMapMem(ScrnInfoPtr pScrn)
     if(pSiS->VGAMapPhys == 0) pSiS->VGAMapPhys = 0xA0000;

 #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,3,0,0,0)
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     (void) pci_device_map_legacy(pSiS->PciInfo, pSiS->VGAMapPhys, pSiS->VGAMapSize,
                                  PCI_DEV_MAP_FLAG_WRITABLE, &pSiS->VGAMemBase);
 #else
@@ -1737,7 +1737,7 @@ SiSVGAUnmapMem(ScrnInfoPtr pScrn)

     if(pSiS->VGAMemBase == NULL) return;

-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     (void) pci_device_unmap_legacy(pSiS->PciInfo, pSiS->VGAMemBase, pSiS->VGAMapSize);
 #else
     xf86UnMapVidMem(pScrn->scrnIndex, pSiS->VGAMemBase, pSiS->VGAMapSize);


code:
$NetBSD: patch-src_tseng__driver.c,v 1.2 2018/05/20 07:27:31 wiz Exp $

From d2d5c8437e401181f56804cc68594c4831a0983d Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Tue, 25 Sep 2012 08:55:02 -0400
Subject: Remove mibstore.h

Signed-off-by: Adam Jackson <ajax@redhat.com>

Other chunks: avoid using removed max.Value fields

diff --git a/src/tseng_driver.c b/src/tseng_driver.c
index ffafb19..0db62e5 100644
--- src/tseng_driver.c.orig	2012-07-17 05:21:17.000000000 +0000
+++ src/tseng_driver.c
@@ -39,9 +39,6 @@
 /* All drivers initialising the SW cursor need this */
 #include "mipointer.h"

-/* All drivers implementing backing store need this */
-#include "mibstore.h"
-
 #include "fb.h"

 #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
@@ -1040,10 +1037,6 @@ TsengPreInit(ScrnInfoPtr pScrn, int flag
     else
 	pTseng->Bytesperpixel = 1;  /* this is fake for < 8bpp, but simplifies other code */

-    /* hardware limits */
-    pScrn->maxHValue = Tseng_HMAX;
-    pScrn->maxVValue = Tseng_VMAX;
-
     /*
      * This must happen after pScrn->display has been set because
      * xf86SetWeight references it.
@@ -1128,16 +1121,15 @@ TsengPreInit(ScrnInfoPtr pScrn, int flag

     /*
      * xf86ValidateModes will check that the mode HTotal and VTotal values
-     * don't exceed the chipset's limit if pScrn->maxHValue and
-     * pScrn->maxVValue are set.  Since our TsengValidMode() already takes
+     * don't exceed the chipset's limit.  Since our TsengValidMode() already takes
      * care of this, we don't worry about setting them here.
      */

     /* Select valid modes from those available */
     i = xf86ValidateModes(pScrn, pScrn->monitor->Modes,
 	pScrn->display->modes, &pTseng->clockRange,
-	NULL, 32, pScrn->maxHValue, 8*pTseng->Bytesperpixel, /* H limits */
-	0, pScrn->maxVValue,	       /* V limits */
+	NULL, 32, Tseng_HMAX, 8*pTseng->Bytesperpixel, /* H limits */
+	0, Tseng_VMAX,	       /* V limits */
 	pScrn->display->virtualX,
 	pScrn->display->virtualY,
 	pTseng->FbMapSize,
@@ -1453,7 +1445,6 @@ TsengScreenInit(SCREEN_INIT_ARGS_DECL)
 	}
     }

-    miInitializeBackingStore(pScreen);
     xf86SetSilkenMouse(pScreen);
     /* Initialise cursor functions */
     miDCInitialize(pScreen, xf86GetPointerScreenFuncs());


code:
Upstream: no (Too lazy)
Reason: newer GCC don't work with these macros

diff --git a/src/vmware.c b/src/vmware.c
index bd8ec37..1bc1fac 100644
--- a/src/vmware.c
+++ b/src/vmware.c
@@ -341,7 +341,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
            SVGA_LEGACY_BASE_PORT + SVGA_VALUE_PORT*sizeof(uint32);
     } else {
         /* Note:  This setting of valueReg causes unaligned I/O */
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
         pVMWARE->portIOBase = pVMWARE->PciInfo->regions[0].base_addr;
 #else
         pVMWARE->portIOBase = pVMWARE->PciInfo->ioBase[0];
@@ -383,7 +383,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
     }
     pVMWARE->suspensionSavedRegId = id;

-#if !XSERVER_LIBPCIACCESS
+#ifndef XSERVER_LIBPCIACCESS
     pVMWARE->PciTag = pciTag(pVMWARE->PciInfo->bus, pVMWARE->PciInfo->device,
                              pVMWARE->PciInfo->func);
 #endif
@@ -727,13 +727,13 @@ static Bool
 VMWAREMapMem(ScrnInfoPtr pScrn)
 {
     VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     int err;
     struct pci_device *const device = pVMWARE->PciInfo;
     void *fbBase;
 #endif

-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
    err = pci_device_map_range(device,
                               pVMWARE->memPhysBase,
                               pVMWARE->videoRam,
@@ -770,7 +770,7 @@ VMWAREUnmapMem(ScrnInfoPtr pScrn)

     VmwareLog(("Unmapped: %p/%u\n", pVMWARE->FbBase, pVMWARE->videoRam));

-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     pci_device_unmap_range(pVMWARE->PciInfo, pVMWARE->FbBase, pVMWARE->videoRam);
 #else
     xf86UnMapVidMem(pScrn->scrnIndex, pVMWARE->FbBase, pVMWARE->videoRam);
@@ -1045,7 +1045,7 @@ static void
 VMWAREInitFIFO(ScrnInfoPtr pScrn)
 {
     VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     struct pci_device *const device = pVMWARE->PciInfo;
     int err;
     void *mmioVirtBase;
@@ -1058,7 +1058,7 @@ VMWAREInitFIFO(ScrnInfoPtr pScrn)

     pVMWARE->mmioPhysBase = vmwareReadReg(pVMWARE, SVGA_REG_MEM_START);
     pVMWARE->mmioSize = vmwareReadReg(pVMWARE, SVGA_REG_MEM_SIZE) & ~3;
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     err = pci_device_map_range(device, pVMWARE->mmioPhysBase,
                                pVMWARE->mmioSize,
                                PCI_DEV_MAP_FLAG_WRITABLE,
@@ -1099,7 +1099,7 @@ VMWAREStopFIFO(ScrnInfoPtr pScrn)
     TRACEPOINT

     vmwareWriteReg(pVMWARE, SVGA_REG_CONFIG_DONE, 0);
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     pci_device_unmap_range(pVMWARE->PciInfo, pVMWARE->mmioVirtBase, pVMWARE->mmioSize);
 #else
     xf86UnMapVidMem(pScrn->scrnIndex, pVMWARE->mmioVirtBase, pVMWARE->mmioSize);
diff --git a/src/vmware.h b/src/vmware.h
index 028dff3..58676b3 100644
--- a/src/vmware.h
+++ b/src/vmware.h
@@ -83,7 +83,7 @@ typedef xXineramaScreenInfo VMWAREXineramaRec, *VMWAREXineramaPtr;

 typedef struct {
     EntityInfoPtr pEnt;
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     struct pci_device *PciInfo;
 #else
     pciVideoPtr PciInfo;
@@ -207,7 +207,7 @@ typedef struct {
 /* Undefine this to kill all acceleration */
 #define ACCELERATE_OPS

-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
 #define VENDOR_ID(p)      (p)->vendor_id
 #define DEVICE_ID(p)      (p)->device_id
 #define SUBVENDOR_ID(p)   (p)->subvendor_id
diff --git a/src/vmware_bootstrap.c b/src/vmware_bootstrap.c
index 0cfac57..efe217e 100644
--- a/src/vmware_bootstrap.c
+++ b/src/vmware_bootstrap.c
@@ -91,7 +91,7 @@ static char vmware_driver_name[] = VMWARE_DRIVER_NAME;
     VMW_STRING(PACKAGE_VERSION_MAJOR) "." VMW_STRING(PACKAGE_VERSION_MINOR) \
     "." VMW_STRING(PACKAGE_VERSION_PATCHLEVEL)

-#if !XSERVER_LIBPCIACCESS
+#ifndef XSERVER_LIBPCIACCESS
 static const char VMWAREBuildStr[] = "VMware Guest X Server "
     VMWARE_DRIVER_VERSION_STRING " - build=$Name$\n";
 #else
@@ -127,7 +127,7 @@ static resRange vmwareLegacyRes[] = {
 #define vmwareLegacyRes NULL
 #endif

-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
 #define VENDOR_ID(p)      (p)->vendor_id
 #define DEVICE_ID(p)      (p)->device_id
 #define SUBVENDOR_ID(p)   (p)->subvendor_id
@@ -141,7 +141,7 @@ static resRange vmwareLegacyRes[] = {
 #define CHIP_REVISION(p)  (p)->chipRev
 #endif

-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)

 #define VMWARE_DEVICE_MATCH(d, i) \
     {PCI_VENDOR_ID_VMWARE, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) }
@@ -220,7 +220,7 @@ vmwgfx_hosted_detect(void);
 static Bool
 VMwarePreinitStub(ScrnInfoPtr pScrn, int flags)
 {
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     struct pci_device *pciInfo;
 #else
     pciVideoPtr pciInfo;
@@ -270,7 +270,7 @@ VMwarePreinitStub(ScrnInfoPtr pScrn, int flags)
     return (*pScrn->PreInit)(pScrn, flags);
 };

-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
 static Bool
 VMwarePciProbe (DriverPtr           drv,
                 int                 entity_num,
@@ -520,7 +520,7 @@ _X_EXPORT DriverRec vmware = {
     VMWARE_DRIVER_VERSION,
     vmware_driver_name,
     VMWAREIdentify,
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     NULL,
 #else
     VMWAREProbe,
@@ -532,7 +532,7 @@ _X_EXPORT DriverRec vmware = {
     VMWareDriverFunc,
 #endif
 #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 4
-#if XSERVER_LIBPCIACCESS
+#if defined(XSERVER_LIBPCIACCESS)
     VMwareDeviceMatch,
     VMwarePciProbe,
 #else


code:
$NetBSD: patch-src_voodoo.h,v 1.1 2015/07/03 10:31:32 wiz Exp $

commit 9172ae566a0e85313fc80ab62b4455393eefe593
Author: Dave Airlie <airlied@redhat.com>
Date:   Mon Sep 22 10:56:02 2014 +1000

    don't use PCITAG in struct anymore

--- src/voodoo.h.orig	2012-07-17 05:21:17.000000000 +0000
+++ src/voodoo.h
@@ -23,7 +23,9 @@ typedef struct {

   Bool		      Voodoo2;		/* Set if Voodoo2 */
   pciVideoPtr	      PciInfo;		/* PCI data */
+#ifndef XSERVER_LIBPCIACCESS
   PCITAG	      PciTag;
+#endif
   CARD32	      PhysBase;

   CARD32	      Width;		/* Current width */


code:
--- ./startx.cpp.orig	2018-03-11 16:07:52.205154560 -0500
+++ ./startx.cpp	2018-03-11 16:09:46.094163992 -0500
@@ -201,6 +201,7 @@
     server=$defaultserver

 #ifdef __linux__
+  if [ -x /lib/elogind/elogind -o -x /lib64/elogind/elogind ]; then
     XCOMM When starting the defaultserver start X on the current tty to avoid
     XCOMM the startx session being seen as inactive:
     XCOMM "https://bugzilla.redhat.com/show_bug.cgi?id=806491"
@@ -209,6 +210,7 @@
         tty_num=$(echo "$tty" | grep -oE '[0-9]+$')
         vtarg="vt$tty_num -keeptty"
     fi
+  fi
 #endif

     XCOMM For compatibility reasons, only use xserverrc if there were no server command line arguments


code:
From a530b6e8923f2b9153a773c8618a1e2f41619288 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Tue, 30 Apr 2019 18:01:27 -0400
Subject: [PATCH] meson: Fix libshadow.so linkage

Don't link against fb, it's the driver's responsibility to load that
first. Underlinking like this is unpleasant but this matches what
autotools does.

Fixes: xorg/xserver#540
---
 hw/xfree86/dixmods/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/xfree86/dixmods/meson.build b/hw/xfree86/dixmods/meson.build
index 835d23215..0562b630f 100644
--- a/hw/xfree86/dixmods/meson.build
+++ b/hw/xfree86/dixmods/meson.build
@@ -34,7 +34,7 @@ shared_module(
     c_args: xorg_c_args,
     dependencies: common_dep,
     link_whole: libxserver_miext_shadow,
-    link_with: [fb, e],
+    link_with: e,

     install: true,
     install_dir: module_dir,
--
2.22.0


code:
diff -upr xterm-323.orig/main.c xterm-323/main.c
--- xterm-323.orig/main.c	2016-03-09 15:30:51.191053881 +0100
+++ xterm-323/main.c	2016-03-09 15:31:17.961635229 +0100
@@ -2654,7 +2654,7 @@ get_pty(int *pty, char *from GCC_UNUSED)
 	close(opened_tty);
 	opened_tty = -1;
     }
-#elif defined(HAVE_POSIX_OPENPT) && defined(HAVE_PTSNAME) && defined(HAVE_GRANTPT_PTY_ISATTY)
+#elif defined(HAVE_POSIX_OPENPT) && defined(HAVE_PTSNAME)
     if ((*pty = posix_openpt(O_RDWR)) >= 0) {
 	char *name = ptsname(*pty);
 	if (name != 0) {
@@ -3735,7 +3735,7 @@ spawnXTerm(XtermWidget xw)
 	    /*
 	     * now in child process
 	     */
-#if defined(_POSIX_SOURCE) || defined(SVR4) || defined(__convex__) || defined(__SCO__) || defined(__QNX__)
+#if defined(_POSIX_VERSION) || defined(SVR4) || defined(__convex__) || defined(__SCO__) || defined(__QNX__)
 	    int pgrp = setsid();	/* variable may not be used... */
 #else
 	    int pgrp = getpid();


code: Matias A. Fonzo, <selk@dragora.org>.

path: qi/AUTHORS


code:
  Thanks to all the following collaborators around the world,
who contributed his grain of sand to this project...
Thanks a lot!  =D

                                  ~ Legend ~

                N = Full name.          D = Description.
                W = Web address.        S = Source, country.
                E = Email.

N: Antonio Diaz Diaz
W: https://lzip.nongnu.org
W: https://git.savannah.nongnu.org/cgit/dragora/toque.git/
E: antonio@gnu.org
D: Toque's mentor: good reviews, suggestions and fresh ideas.
S: Spain

N: Alan Beadle
E: ab.beadle@gmail.com
D: Correctness and suggestions for English messages.
S: USA

N: Eduardo A. Bustamante Lopez
W: https://dualbus.me
E: dualbus@gmail.com
D: Code snippets, examples and suggestions.
S: Mexico

N: Ben Zanin
E: bzanin@gmail.com
D: "POSIX" regular expression used for ed(1).
S: Canada

N: Peter Samuel
W: https://peters.gormand.com.au
E: peter.r.samuel@gmail.com
D: Graft's creator and maintainer.
S: Australia, Canada

N: Mateu Pinto Rodrigues
W: https://csphy.blue/mprodrigues
E: mprodrigues@dragora.org
D: Qi beta tester, bug reports, suggestions.
S: Brazil

N: Michael Siegel
W: https://www.msiism.org
E: msi@dragora.org
D: Qi beta tester, bug reports, improvements and suggestions.
S: Germany

path: qi/CREDITS


code:
# Makefile for Qi.
#
# Copyright (c) 2015-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

project		= qi
version		= 2.10-rc1

## DO NOT MAKE CHANGES HERE.
#
# Use config.mak to override any of the following variables:
prefix		= /usr/local
exec_prefix	= $(prefix)
bindir		= $(exec_prefix)/bin
sbindir		= $(exec_prefix)/sbin
libexecdir	= $(exec_prefix)/libexec
sysconfdir	= $(prefix)/etc
localstatedir	= $(prefix)/var
datarootdir	= $(prefix)/share
infodir		= $(datarootdir)/info
mandir		= $(datarootdir)/man
docdir		= $(datarootdir)/doc
packagedir	= /usr/local/pkgs
targetdir	= /usr/local
arch		= $(shell uname -m)
##
DISTNAME	= ${project}-${version}

MAKEINFO	= makeinfo
INSTALL         = install
INSTALL_PROGRAM = ${INSTALL} -p -m 755
INSTALL_DATA    = ${INSTALL} -p -m 644
INSTALL_DIR     = mkdir -p -m 755
HELP2MAN_OPTS   = --locale=C --version-string=${version}

.PHONY: all \
	doc info man html \
	dist distclean clean \
	install install-info \
	uninstall uninstall-info

-include config.mak

all : $(project) $(project)rc

$(project) : src/$(project)

src/$(project) : src/$(project).in

	@echo "Making src/$(project) ..."
	@echo ""
	sed -e "s|@VERSION@|$(version)|g" \
	  -e "s|@PREFIX@|$(prefix)|g" \
	  -e "s|@BINDIR@|$(bindir)|g" \
	  -e "s|@SBINDIR@|$(sbindir)|g" \
	  -e "s|@LIBEXECDIR@|$(libexecdir)|g" \
	  -e "s|@SYSCONFDIR@|$(sysconfdir)|g" \
	  -e "s|@LOCALSTATEDIR@|$(localstatedir)|g" \
	  -e "s|@INFODIR@|$(infodir)|g" \
	  -e "s|@MANDIR@|$(mandir)|g" \
	  -e "s|@DOCDIR@|$(docdir)|g" \
	  -e "s|@PACKAGEDIR@|$(packagedir)|g" \
	  -e "s|@TARGETDIR@|$(targetdir)|g" \
	  -e "s|@ARCH@|$(arch)|g" \
	 $< > $@ && \
	 chmod 755 $@

$(project)rc : etc/$(project)rc

etc/$(project)rc : etc/$(project)rc.in

	@echo "Making config: etc/$(project)rc ..."
	@echo ""
	sed -e "s|@PREFIX@|$(prefix)|g" \
	  -e "s|@BINDIR@|$(bindir)|g" \
	  -e "s|@SBINDIR@|$(sbindir)|g" \
	  -e "s|@LIBEXECDIR@|$(libexecdir)|g" \
	  -e "s|@SYSCONFDIR@|$(sysconfdir)|g" \
	  -e "s|@LOCALSTATEDIR@|$(localstatedir)|g" \
	  -e "s|@INFODIR@|$(infodir)|g" \
	  -e "s|@MANDIR@|$(mandir)|g" \
	  -e "s|@DOCDIR@|$(docdir)|g" \
	  -e "s|@PACKAGEDIR@|$(packagedir)|g" \
	  -e "s|@TARGETDIR@|$(targetdir)|g" \
	  -e "s|@ARCH@|$(arch)|g" \
	 $< > $@ && \
	chmod 644 $@

doc : info man html

info : doc/$(project).info

doc/$(project).info : doc/$(project)-header.texi doc/$(project)-content.texi
	cd doc && env LANG=C $(MAKEINFO) $(project)-header.texi -o $(project).info

man : doc/$(project).1

doc/qi.1 : doc/$(project).1.in src/$(project).in
	env LANG=C help2man ${HELP2MAN_OPTS} \
	 --name="a simple but well-integrated package manager" \
	 --info-page=qi \
	 --output=$@ doc/$(project).1.in
	 sed -e "s#QI.1.IN#QI#g" -e "s#qi.1.in#qi#g" -i $@

html : doc/$(project).html

doc/$(project).html : doc/$(project)-header.texi doc/$(project)-content.texi
	cd doc && env LANG=C $(MAKEINFO) --html --no-split \
	 $(project)-header.texi -o $(project).html

dist : doc
	rm -f $(DISTNAME)
	ln -sf . $(DISTNAME)
	tarlz --solid -9 -cvf $(DISTNAME).tar.lz \
	  $(DISTNAME)/AUTHORS \
	  $(DISTNAME)/COPYING \
	  $(DISTNAME)/CREDITS \
	  $(DISTNAME)/Makefile \
	  $(DISTNAME)/NEWS \
	  $(DISTNAME)/README.md \
	  $(DISTNAME)/configure \
	  $(DISTNAME)/doc/example.order \
	  $(DISTNAME)/doc/fdl.txt \
	  $(DISTNAME)/doc/qi.1 \
	  $(DISTNAME)/doc/qi.1.in \
	  $(DISTNAME)/doc/$(project).html \
	  $(DISTNAME)/doc/$(project).info \
	  $(DISTNAME)/doc/$(project)-header.texi \
	  $(DISTNAME)/doc/$(project)-content.texi \
	  $(DISTNAME)/doc/recipe1 \
	  $(DISTNAME)/doc/recipe2 \
	  $(DISTNAME)/doc/recipe3 \
	  $(DISTNAME)/etc/$(project)rc.in \
	  $(DISTNAME)/src/qi.in
	rm -f $(DISTNAME)
	sha256sum $(DISTNAME).tar.lz > $(DISTNAME).tar.lz.sha256

distclean : clean
	-rm -f *.tar *.tar.lz *.tar.lz.*

clean :
	-rm -f src/$(project) etc/$(project)rc config.mak

install : all install-info install-man

	@echo ""
	@echo "* Checking required directories ..."
	if [ ! -d "$(DESTDIR)${bindir}" ] ; then \
	  $(INSTALL_DIR) "$(DESTDIR)${bindir}" ; \
	fi
	if [ ! -d "$(DESTDIR)${sysconfdir}" ] ; then \
	  $(INSTALL_DIR) "$(DESTDIR)${sysconfdir}" ; \
	fi

	@echo ""
	@echo "* Installing on $(DESTDIR)${bindir} ..."
	$(INSTALL_PROGRAM) src/$(project) "$(DESTDIR)${bindir}/$(project)"

	@echo ""
	@echo "* Installing config file on $(DESTDIR)${sysconfdir} ..."
	$(INSTALL_DATA) etc/$(project)rc "$(DESTDIR)${sysconfdir}/$(project)rc"

	@echo ""
	@echo "* Creating package and target directory (if needed) ..."
	if [ ! -d "$(DESTDIR)${packagedir}" ] ; then \
	  $(INSTALL_DIR) "$(DESTDIR)${packagedir}" ; \
	fi
	if [ ! -d "$(DESTDIR)${targetdir}" ] ; then \
	  $(INSTALL_DIR) "$(DESTDIR)${targetdir}" ; \
	fi
	@echo ""
	@echo "Done."

install-info :

	@echo ""
	@echo "* Installing Info document on $(DESTDIR)${infodir} ..."
	if [ ! -d "$(DESTDIR)${infodir}" ] ; then \
	    $(INSTALL_DIR) "$(DESTDIR)${infodir}" ; \
	fi

	$(INSTALL_DATA) doc/$(project).info \
	"$(DESTDIR)${infodir}/$(project).info"

	-install-info --info-dir="$(DESTDIR)${infodir}" \
	"$(DESTDIR)${infodir}/$(project).info"

install-man :

	@echo ""
	@echo "* Installing manual pages on $(DESTDIR)${mandir}/man1 ..."
	if [ ! -d "$(DESTDIR)${mandir}/man1" ] ; then \
	    $(INSTALL_DIR) "$(DESTDIR)${mandir}/man1" ; \
	fi

	$(INSTALL_DATA) doc/$(project).1 "$(DESTDIR)${mandir}/man1"

uninstall : uninstall-info uninstall-man

	@echo ""
	@echo "* Uninstalling from $(DESTDIR)${bindir} ..."
	-rm -f "$(DESTDIR)${bindir}/$(project)"

	-rm -f "$(DESTDIR)${sysconfdir}/$(project)rc"

uninstall-info :

	-install-info \
	--info-dir="$(DESTDIR)${infodir}" \
	--remove "$(DESTDIR)${infodir}/$(project).info"

	-rm -f "$(DESTDIR)${infodir}/$(project).info"

uninstall-man :

	-rm -f "$(DESTDIR)${mandir}/man1/$(project).1"

path: qi/Makefile


code:
2022-06-22  Matias Fonzo  <selk@dragora.org>

    * Version 2.9 released.

    * Allow passing or changing options to tarlz(1) via configuration file
      (qirc) or just setting the special variable 'tarlz_compression_options'
      from a particular recipe.

    * Adjusted the simple detection of the package directory when trying
      to remove a package, this avoids a possible collision if it finds
      the package name as a regular file.

    * recipes: Added support for zstd(1) extensions.

    * recipes: Sample recipes have been updated.

2022-05-02  Matias Fonzo  <selk@dragora.org>

    * Version 2.8 released.

    * Use full remove mode when upgrading a package.  The purpose of this
      change is to clean up the removal of a previous package when the
      upgrade mode is invoked.  Previously the package documentation
      directory (and other possible files) were left on the filesystem.

    * Minor enhancements.

2021-12-14  Matias Fonzo  <selk@dragora.org>

    * Version 2.7 released.

    * Now Qi is more precise with exit status number 4 and 6, by hitting
      "exit" instead of just returning from the functions.

    * Small corrections for the description of Qi and also for the manual
      have been sent by Antonio Diaz Diaz.  Thanks!

2021-11-01  Matias Fonzo  <selk@dragora.org>

    * Version 2.6 released.

    * build: Make a checksum file for the copy of the recipe (the one
      included in the package, from which the recipe was built).

    * Do not read the configuration file on create, extract, and order
      modes.  It is not necessary to read the config file in these modes.

    * Minor changes.

2021-09-28  Matias Fonzo  <selk@dragora.org>

    * Version 2.5 released.

    * Searching for previously installed packages in an upgrade has been
      simplified, which will speed up and save resources in upgrade mode.

    * The network downloader has been changed to make use of GNU Wget2.

    * Minor enhancements.

2021-04-12  Matias Fonzo  <selk@dragora.org>

    * Version 2.4 released.

    * recipes: Added the variable "QICPPFLAGS" to pass the C/C++
      preprocessor flags to the environment variable "CPPFLAGS".

    * recipes: Added the "docs" and "docsdir" variables to be unset
      after processing a recipe.

    * recipes: Added support for executing other defined functions
      besides the main build() function.

    * recipes: Include build flags only if it is a real architecture
      when creating a package meta.

    * Change default values for QICFLAGS, QICXXFLAGS from "-g0 -O2" to
      just "-O2".  Including default value for LDFLAGS from "-s" to
      just "" (none).  This is to provide more generic values in the
      package manager distribution.

    * The documentation is in line with the changes made, plus the
      sample recipes have been updated.

    * Minor changes.

2020-12-25  Matias Fonzo  <selk@dragora.org>

    * Version 2.3 released.

    * doc: The general documentation of Qi has been divided to allow its
      inclusion from other .texi files.  This does not affect the internal
      functioning of Qi or the reading of the documentation for the user,
      but rather it prepares for the incoming Dragora Handbook (Dragora is
      the project from which Qi is currently developed).

    * Minor changes.

2020-11-09  Matias Fonzo  <selk@dragora.org>

    * Version 2.2 released.

    * Get the absolute path name to compose the current working directory
      when build.  A bug introduced in qi-2.0.

    * The readconfig() function has been simplified.

2020-09-07  Matias Fonzo  <selk@dragora.org>

    * Version 2.1 released.

    * Make the code for searching previous packages in an upgrade work again
      (bug introduced in previous version).

    * Minor changes.

2020-08-22  Matias Fonzo  <selk@dragora.org>

    * Version 2.0 released.

    * The user interface has been revised to better differenciate commands
      and options, for example: `qi install` instead of `qi -i`, `qi remove`
      instead of `qi -d`, `qi upgrade` instead of `qi -u`, `qi build`
      instead of `qi -b`, and so on.

    * The layout of the produced package names has been changed to better
      differenciate the software name and its version.

      Before: name-version-architecture-release[@pkgcategory].tlz
      Now:    name_version_architecture-release[@pkgcategory].tlz

    * The verbosity level has been changed to a minimal but essential result,
      while it can now be adjusted from the configuration file.

    * configure: The --arch= option has been added to define the default
      package architecture.

    * install: Fix assignation of 'rootdir' when it is empty and it
      relies on the value of 'targetdir' when runs a post-install script
      from subshell.

    * doc: Fix examples for 'rootdir' since the package directory and
      the target directory are relative to the specified root directory.

    * recipes: Add the special variable 'keep_destdir' to complement
      'keep_srcdir' in order to preserve 'destdir' when using build command.

    * Be quieter by default in relation to the graft(1) output, if the
      -v option is given it returns to the previous qi output behavior.

    * Set the --missing-crc option to tarlz(1) by default to make the
      package integrity check more reliable.

    * Use the power of awk(1) to display package descriptions.

    * Check and report if qi is connected to a terminal when reading from
      standard input.

    * Qi's messages have been improved to differentiate themselves from
      the output of other programs.

    * Added "coreutils", "bash", and "mksh" to the blacklist filter when
      upgrading packages.

    * Support for the SOURCE_DATE_EPOCH specification has been added.
      See: https://reproducible-builds.org/specs/source-date-epoch/

    * Default Qi C flags to be passed to the compiler (QICFLAGS, QICXXFLAGS)
      has been changed from "-g0 -Os" to "-g0 -O2".

    * The DESCRIPTION, OPTIONS, and ENVIRONMENT sections for the man page
      (generated by help2man) have been reorganized.

    * The main Info manual has been refreshed to reflect all these changes.

    * The examples in the doc directory have been updated.

    * The CREDITS file has been updated.

    * Code clean up and minor (but important) enhancements.

2020-04-20  Matias Fonzo  <selk@dragora.org>

    * Version 1.4 released.

    * build: Added support for optional "package category".  If the
      variable 'pkgcategory' is declared in a recipe, Qi will produce
      packages ala "<name>-<version>-<architecture>+release@category".

    * general: The configuration file is now included instead of being
      analyzed.  This is to have more room to declare things in general.

    * build: The 'arch' value is used as suffix for produced packages
      in order to have a well-organized (per-arch) output directory,
      e.g:
       /var/cache/qi/packages/noarch/
       /var/cache/qi/packages/i586/
       /var/cache/qi/packages/x86_64/
       ...

    * The code of blacklisted packages in the updates has been simplified.

    * doc: The "Variables from the environment" section has been improved.

    * build: The 'full_pkgname' variable is now added on the meta tag file.

    * doc: The manual has been updated to conform to this version.

    * Minor changes.

2019-09-10  Matias Fonzo  <selk@dragora.org>

    * Version 1.3 released.

    * Check the exit status when a recipe is imported or included.
      This will help to catch possible errors when using shell code,
      rather than proceeding with the recipe.

    * Minor changes.

2019-07-30  Matias Fonzo  <selk@dragora.org>

    * Version 1.2 released.

    * The variable 'arch' has been added to the package meta file,
      additionally, the variables 'program' and 'version' has been
      replaced with 'pkgname' and 'pkgversion' which take the value
      of those if they have not been previously established.

    * Minor changes.

2019-05-19  Matias Fonzo  <selk@dragora.org>

    * Version 1.1 released.

    * Default external tool for uncompressing files based on .tar.lz
      archives has been changed in the unpack() function from tarlz(1) to
      lzip(1) in combination with tar(1).  This is because some files
      could have been produced using a header format that differs from the
      default format used by tarlz(1), e.g. the GNU format (by GNU tar).

    * Some phrases have been improved in the manual, under the section
      "5.3 Writing recipes".  Thanks to kelsoo.

2019-04-15  Matias Fonzo  <selk@dragora.org>

    * Version 1.0 (stable) released.

    * The manual (user guide) has been updated.

path: qi/NEWS


code:
Qi
==

Qi is a simple but well-integrated package manager.  It can create,
install, remove, and upgrade software packages.  Qi produces binary
packages using recipes, which are files containing specific instructions
to build each package from source.  Qi can manage multiple packages
under a single directory hierarchy.  This method allows to maintain a
set of packages and multiple versions of them.  This means that Qi could
be used as the main package manager or complement the existing one.

   Qi offers a friendly command line interface, a global configuration
file, a simple recipe layout to deploy software packages; also works
with binary packages in parallel, speeding up installations and packages
in production.  The format used for packages is a simplified and safer
variant of POSIX pax archive compressed in lzip format.

   Qi is a modern (POSIX-compliant) shell script released under the
terms of the GNU General Public License.  There are only two major
dependencies for the magic: graft(1) and tarlz(1), the rest is expected
to be found in any Unix-like system.

Requirements
------------

- A POSIX-compliant shell.

- Graft for handling symlinks: https://peters.gormand.com.au/Home/tools
  Alternatively from https://rsync.dragora.org/current/sources/

- Perl in order to run Graft: https://www.perl.org

- Tarlz for produce binary packages: https://lzip.nongnu.org/tarlz.html

Optional but highly recommended dependencies (at run-time) are:

- ed(1), tar(1), unzip(1), gzip(1), bzip2(1), lzip(1), xz(1).

These recommended dependencies are to support the testing and
unpacking of tarballs, as well as compressed files in these formats.

Other system utilities that are checked and expected by Qi are:

- awk(1), basename(1), chmod(1), cp(1), dirname(1), find(1), fold(1),
  grep(1), mkdir(1), mktemp(1), rm(1), rmdir(1), sed(1), sha256sum(1),
  stat(1).

### Note

Take into account when you are going to install graft, you can define some
macros like PACKAGEDIR and TARGETDIR.  To be consistent, please use the
same paths when `configure` adjusting them through the --packagedir and
--targetdir options.

If you have not changed the default values used on the graft installation,
you can avoid these steps, since qi uses the same values of graft for
PACKAGEDIR and TARGETDIR.

Installation
------------

To configure, make and install qi, type:

    $ ./configure
    $ make
    $ make install

See `./configure --help` for more options.

To install qi in a different location, type:

    $ make DESTDIR=/tmp/qi install

This is useful for package distributors.

Contact
-------

  The Qi home page can be found at https://www.dragora.org.
Send bug reports or suggestions to <dragora-users@nongnu.org>.


code:
#! /bin/sh -
#
# Simple "configure" script for Qi.
#
# Copyright (c) 2016-2018, 2020-2021 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -e

usage() {
    printf '%s' \
"Usage: configure [options]

Defaults for the options are specified in brackets.

Options:
  --prefix=DIR         install files in DIR [${prefix}]
  --exec-prefix=DIR    base DIR for arch-dependent files [${exec_prefix}]
  --bindir=DIR         user executables [${bindir}]
  --sbindir=DIR        system admin executables [${sbindir}]
  --libexecdir=DIR     program executables [${libexecdir}]
  --sysconfdir=DIR     read-only single-machine data [${sysconfdir}]
  --localstatedir=DIR  modifiable single-machine data [${localstatedir}]
  --datarootdir=DIR    read-only arch-independent data root [${datarootdir}]
  --infodir=DIR        info documentation [${infodir}]
  --mandir=DIR         man documentation [${mandir}]
  --docdir=DIR         documentation root [${docdir}]
  --packagedir=DIR     set directory for package installations [${packagedir}]
  --targetdir=DIR      set target directory for symbolic links [${targetdir}]
  --arch=name          set default package architecture [${arch}]

"
}

# Defaults
prefix=/usr/local
exec_prefix='$(prefix)'
bindir='$(exec_prefix)/bin'
sbindir='$(exec_prefix)/sbin'
libexecdir='$(exec_prefix)/libexec'
sysconfdir='$(prefix)/etc'
localstatedir='$(prefix)/var'
datarootdir='$(prefix)/share'
infodir='$(datarootdir)/info'
mandir='$(datarootdir)/man'
docdir='$(datarootdir)/doc'
packagedir='/usr/local/pkgs'
targetdir='/usr/local'
arch="$(uname -m)"

return_variables() {
    printf '%s\n' \
     "prefix = $prefix"                \
     "exec_prefix = $exec_prefix"      \
     "bindir = $bindir"                \
     "sbindir = $sbindir"              \
     "libexecdir = $libexecdir"        \
     "sysconfdir = $sysconfdir"        \
     "localstatedir = $localstatedir"  \
     "datarootdir = $datarootdir"      \
     "infodir = $infodir"              \
     "mandir = $mandir"                \
     "docdir = $docdir"                \
     "packagedir = $packagedir"        \
     "targetdir = $targetdir"          \
     "arch = $arch"                    \
     ""
}

# Handle options
while test $# -gt 0
do
    case $1 in
    --prefix)
        prefix="$2"
        shift
        ;;
    --prefix=*)
        prefix="${1#*=}"
        ;;
    --exec-prefix)
        exec_prefix="$2"
        shift
        ;;
    --exec-prefix=*)
        exec_prefix="${1#*=}"
        ;;
    --bindir)
        bindir="$2"
        shift
        ;;
    --bindir=*)
        bindir="${1#*=}"
        ;;
    --sbindir)
        sbindir="$2"
        shift
        ;;
    --sbindir=*)
        sbindir="${1#*=}"
        ;;
    --libexecdir)
        libexecdir="$2"
        shift
        ;;
    --libexecdir=*)
        libexecdir="${1#*=}"
        ;;
    --sysconfdir)
        sysconfdir="$2"
        shift
        ;;
    --sysconfdir=*)
        sysconfdir="${1#*=}"
        ;;
    --localstatedir)
        localstatedir="$2"
        shift
        ;;
    --localstatedir=*)
        localstatedir="${1#*=}"
        ;;
    --datarootdir)
        datarootdir="$2"
        shift
        ;;
    --datarootdir=*)
        datarootdir="${1#*=}"
        ;;
    --infodir)
        infodir="$2"
        shift
        ;;
    --infodir=*)
        infodir="${1#*=}"
        ;;
    --mandir)
        mandir="$2"
        shift
        ;;
    --mandir=*)
        mandir="${1#*=}"
        ;;
    --docdir)
        docdir="$2"
        shift
        ;;
    --docdir=*)
        docdir="${1#*=}"
        ;;
    --packagedir)
        packagedir="$2"
        shift
        ;;
    --packagedir=*)
        packagedir="${1#*=}"
        ;;
    --targetdir)
        targetdir="$2"
        shift
        ;;
    --targetdir=*)
        targetdir="${1#*=}"
        ;;
    --arch)
        arch="$2"
        shift
        ;;
    --arch=*)
        arch="${1#*=}"
        ;;
    --help | --hel | --he | --h | '--?' | -help | -hel | -he | -h | '-?' )
        usage
        exit
        ;;
    --)
        shift
        break;	# End of options.
        ;;
    -*)
        echo "configure: WARNING: unrecognized option '${1}'" 1>&2
        ;;
    *)
        break
        ;;
    esac
    shift
done

echo "Creating config.mak ..."

return_variables;		# Show configured variables.
: > config.mak;			# Clean up config.mak, first.

if return_variables > config.mak
then
    touch src/qi.in && echo "OK, now you can run \`make'"
fi

path: qi/configure


code:
# HOW TO READ THIS FILE:
#
# If 'a' depends on 'b' and 'c', and 'c' depends on 'b' as well,
# the file might look like:
#
#   a.recipe: c.recipe b.recipe
#   b.recipe:
#   c.recipe: b.recipe
#
# Each letter represents a recipe name, complete dependencies for
# the first recipe name are listed in descending order, which is
# printed from right to left, and removed from left to right:
#
#   b.recipe
#   c.recipe
#   a.recipe
#
# Commented lines starting with a '#' are allowed.  Blank lines,
# colons, parentheses, and end of line are removed.
#
# For more information, type: info qi 'order files'
#

# This is a commentary line

a.recipe: c.recipe b.recipe
b.recipe:
c.recipe: b.recipe


code:
                GNU Free Documentation License
                 Version 1.3, 3 November 2008

 Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
     <https://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

0. PREAMBLE

The purpose of this License is to make a manual, textbook, or other
functional and useful document "free" in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.

This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense.  It
complements the GNU General Public License, which is a copyleft
license designed for free software.

We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does.  But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book.  We recommend this License
principally for works whose purpose is instruction or reference.

1. APPLICABILITY AND DEFINITIONS

This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License.  Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein.  The "Document", below,
refers to any such manual or work.  Any member of the public is a
licensee, and is addressed as "you".  You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.

A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.

A "Secondary Section" is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall
subject (or to related matters) and contains nothing that could fall
directly within that overall subject.  (Thus, if the Document is in
part a textbook of mathematics, a Secondary Section may not explain
any mathematics.)  The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.

The "Invariant Sections" are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License.  If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant.  The Document may contain zero
Invariant Sections.  If the Document does not identify any Invariant
Sections then there are none.

The "Cover Texts" are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License.  A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.

A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters.  A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text.  A copy that is not "Transparent" is called "Opaque".

Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML, PostScript or PDF designed for human modification.  Examples of
transparent image formats include PNG, XCF and JPG.  Opaque formats
include proprietary formats that can be read and edited only by
proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML, PostScript or PDF produced by some word
processors for output purposes only.

The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page.  For works in
formats which do not have any title page as such, "Title Page" means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.

The "publisher" means any person or entity that distributes copies of
the Document to the public.

A section "Entitled XYZ" means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language.  (Here XYZ stands for a
specific section name mentioned below, such as "Acknowledgements",
"Dedications", "Endorsements", or "History".)  To "Preserve the Title"
of such a section when you modify the Document means that it remains a
section "Entitled XYZ" according to this definition.

The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document.  These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.

2. VERBATIM COPYING

You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no
other conditions whatsoever to those of this License.  You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute.  However, you may accept
compensation in exchange for copies.  If you distribute a large enough
number of copies you must also follow the conditions in section 3.

You may also lend copies, under the same conditions stated above, and
you may publicly display copies.

3. COPYING IN QUANTITY

If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover.  Both covers must also clearly and legibly identify
you as the publisher of these copies.  The front cover must present
the full title with all words of the title equally prominent and
visible.  You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.

If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.

If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.

It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to
give them a chance to provide you with an updated version of the
Document.

4. MODIFICATIONS

You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it.  In addition, you must do these things in the Modified Version:

A. Use in the Title Page (and on the covers, if any) a title distinct
   from that of the Document, and from those of previous versions
   (which should, if there were any, be listed in the History section
   of the Document).  You may use the same title as a previous version
   if the original publisher of that version gives permission.
B. List on the Title Page, as authors, one or more persons or entities
   responsible for authorship of the modifications in the Modified
   Version, together with at least five of the principal authors of the
   Document (all of its principal authors, if it has fewer than five),
   unless they release you from this requirement.
C. State on the Title page the name of the publisher of the
   Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications
   adjacent to the other copyright notices.
F. Include, immediately after the copyright notices, a license notice
   giving the public permission to use the Modified Version under the
   terms of this License, in the form shown in the Addendum below.
G. Preserve in that license notice the full lists of Invariant Sections
   and required Cover Texts given in the Document's license notice.
H. Include an unaltered copy of this License.
I. Preserve the section Entitled "History", Preserve its Title, and add
   to it an item stating at least the title, year, new authors, and
   publisher of the Modified Version as given on the Title Page.  If
   there is no section Entitled "History" in the Document, create one
   stating the title, year, authors, and publisher of the Document as
   given on its Title Page, then add an item describing the Modified
   Version as stated in the previous sentence.
J. Preserve the network location, if any, given in the Document for
   public access to a Transparent copy of the Document, and likewise
   the network locations given in the Document for previous versions
   it was based on.  These may be placed in the "History" section.
   You may omit a network location for a work that was published at
   least four years before the Document itself, or if the original
   publisher of the version it refers to gives permission.
K. For any section Entitled "Acknowledgements" or "Dedications",
   Preserve the Title of the section, and preserve in the section all
   the substance and tone of each of the contributor acknowledgements
   and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document,
   unaltered in their text and in their titles.  Section numbers
   or the equivalent are not considered part of the section titles.
M. Delete any section Entitled "Endorsements".  Such a section
   may not be included in the Modified Version.
N. Do not retitle any existing section to be Entitled "Endorsements"
   or to conflict in title with any Invariant Section.
O. Preserve any Warranty Disclaimers.

If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant.  To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.

You may add a section Entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.

You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version.  Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity.  If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.

The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.

5. COMBINING DOCUMENTS

You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.

The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy.  If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.

In the combination, you must combine any sections Entitled "History"
in the various original documents, forming one section Entitled
"History"; likewise combine any sections Entitled "Acknowledgements",
and any sections Entitled "Dedications".  You must delete all sections
Entitled "Endorsements".

6. COLLECTIONS OF DOCUMENTS

You may make a collection consisting of the Document and other
documents released under this License, and replace the individual
copies of this License in the various documents with a single copy
that is included in the collection, provided that you follow the rules
of this License for verbatim copying of each of the documents in all
other respects.

You may extract a single document from such a collection, and
distribute it individually under this License, provided you insert a
copy of this License into the extracted document, and follow this
License in all other respects regarding verbatim copying of that
document.

7. AGGREGATION WITH INDEPENDENT WORKS

A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an "aggregate" if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.

If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.

8. TRANSLATION

Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections.  You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers.  In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.

If a section in the Document is Entitled "Acknowledgements",
"Dedications", or "History", the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.

9. TERMINATION

You may not copy, modify, sublicense, or distribute the Document
except as expressly provided under this License.  Any attempt
otherwise to copy, modify, sublicense, or distribute it is void, and
will automatically terminate your rights under this License.

However, if you cease all violation of this License, then your license
from a particular copyright holder is reinstated (a) provisionally,
unless and until the copyright holder explicitly and finally
terminates your license, and (b) permanently, if the copyright holder
fails to notify you of the violation by some reasonable means prior to
60 days after the cessation.

Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, receipt of a copy of some or all of the same material does
not give you any rights to use it.

10. FUTURE REVISIONS OF THIS LICENSE

The Free Software Foundation may publish new, revised versions of the
GNU Free Documentation License from time to time.  Such new versions
will be similar in spirit to the present version, but may differ in
detail to address new problems or concerns.  See
https://www.gnu.org/licenses/.

Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation.  If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.  If the Document
specifies that a proxy can decide which future versions of this
License can be used, that proxy's public statement of acceptance of a
version permanently authorizes you to choose that version for the
Document.

11. RELICENSING

"Massive Multiauthor Collaboration Site" (or "MMC Site") means any
World Wide Web server that publishes copyrightable works and also
provides prominent facilities for anybody to edit those works.  A
public wiki that anybody can edit is an example of such a server.  A
"Massive Multiauthor Collaboration" (or "MMC") contained in the site
means any set of copyrightable works thus published on the MMC site.

"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
license published by Creative Commons Corporation, a not-for-profit
corporation with a principal place of business in San Francisco,
California, as well as future copyleft versions of that license
published by that same organization.

"Incorporate" means to publish or republish a Document, in whole or in
part, as part of another Document.

An MMC is "eligible for relicensing" if it is licensed under this
License, and if all works that were first published under this License
somewhere other than this MMC, and subsequently incorporated in whole or
in part into the MMC, (1) had no cover texts or invariant sections, and
(2) were thus incorporated prior to November 1, 2008.

The operator of an MMC Site may republish an MMC contained in the site
under CC-BY-SA on the same site at any time before August 1, 2009,
provided the MMC is eligible for relicensing.

ADDENDUM: How to use this License for your documents

To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:

    Copyright (c)  YEAR  YOUR NAME.
    Permission is granted to copy, distribute and/or modify this document
    under the terms of the GNU Free Documentation License, Version 1.3
    or any later version published by the Free Software Foundation;
    with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
    A copy of the license is included in the section entitled "GNU
    Free Documentation License".

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the "with...Texts." line with this:

    with the Invariant Sections being LIST THEIR TITLES, with the
    Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.

If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.

If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.