Merge branch 'staging'

+706 -34
-6
pkgs/development/libraries/fontconfig/2.10.nix
··· 8 8 sha256 = "0llraqw86jmw4vzv7inskp3xxm2gc64my08iwq5mzncgfdbfza4f"; 9 9 }; 10 10 11 - patches = [ 12 - # FreeType 2.7 prefixes PCF font family names with the foundry name. 13 - # The output of fc-list and fc-query change which breaks the tests. 14 - ./test-pcf-family-names-freetype-2.7.patch 15 - ]; 16 - 17 11 outputs = [ "bin" "dev" "lib" "out" ]; # $out contains all the config 18 12 19 13 propagatedBuildInputs = [ freetype ];
-4
pkgs/development/libraries/fontconfig/default.nix
··· 33 33 url = "https://cgit.freedesktop.org/fontconfig/patch/?id=1ab5258f7c"; 34 34 sha256 = "0x2a4qx51j3gqcp1kp4lisdzmhrkw1zw0r851d82ksgjlc0vkbaz"; 35 35 }) 36 - 37 - # FreeType 2.7 prefixes PCF font family names with the foundry name. 38 - # The output of fc-list and fc-query change which breaks the tests. 39 - ./test-pcf-family-names-freetype-2.7.patch 40 36 ]; 41 37 # additionally required for the glibc-2.25 patch; avoid requiring gperf 42 38 postPatch = ''
-18
pkgs/development/libraries/fontconfig/test-pcf-family-names-freetype-2.7.patch
··· 1 - diff -Nuar fontconfig-2.10.2-orig/test/out.expected fontconfig-2.10.2/test/out.expected 2 - --- fontconfig-2.10.2-orig/test/out.expected 2017-03-06 06:45:50.876053093 -0600 3 - +++ fontconfig-2.10.2/test/out.expected 2017-03-06 06:48:18.012514337 -0600 4 - @@ -1,8 +1,8 @@ 5 - -Fixed:pixelsize=16 6 - -Fixed:pixelsize=6 7 - +Misc Fixed:pixelsize=6 8 - +Sony Fixed:pixelsize=16 9 - = 10 - -Fixed:pixelsize=16 11 - -Fixed:pixelsize=6 12 - +Misc Fixed:pixelsize=6 13 - +Sony Fixed:pixelsize=16 14 - = 15 - -Fixed:pixelsize=16 16 - -Fixed:pixelsize=6 17 - +Misc Fixed:pixelsize=6 18 - +Sony Fixed:pixelsize=16
+7 -2
pkgs/development/libraries/freetype/default.nix
··· 43 43 ++ optional (!stdenv.isLinux) gnumake; 44 44 45 45 patches = 46 - [ ./enable-table-validation.patch ] 47 - ++ optional useEncumberedCode ./enable-subpixel-rendering.patch; 46 + [ 47 + ./pcf-introduce-driver.patch 48 + ./pcf-config-long-family-names.patch 49 + ./disable-pcf-long-family-names.patch 50 + ./enable-table-validation.patch 51 + ] ++ 52 + optional useEncumberedCode ./enable-subpixel-rendering.patch; 48 53 49 54 outputs = [ "out" "dev" ]; 50 55
+15
pkgs/development/libraries/freetype/disable-pcf-long-family-names.patch
··· 1 + diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h 2 + index 5676074..37a0d00 100644 3 + --- a/include/freetype/config/ftoption.h 4 + +++ b/include/freetype/config/ftoption.h 5 + @@ -856,7 +856,7 @@ FT_BEGIN_HEADER 6 + /* If this option is activated, it can be controlled with the */ 7 + /* `no-long-family-names' property of the pcf driver module. */ 8 + /* */ 9 + -#define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES 10 + +/* #define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */ 11 + 12 + 13 + /*************************************************************************/ 14 + -- 15 + cgit v1.0-41-gc330
+553
pkgs/development/libraries/freetype/pcf-config-long-family-names.patch
··· 1 + diff --git a/devel/ftoption.h b/devel/ftoption.h 2 + index 3b63931..b8b0a8d 100644 3 + --- a/devel/ftoption.h 4 + +++ b/devel/ftoption.h 5 + @@ -82,8 +82,8 @@ FT_BEGIN_HEADER 6 + /* to control the various font drivers and modules. The controllable */ 7 + /* properties are listed in the section `Controlling FreeType Modules' */ 8 + /* in the reference's table of contents; currently there are properties */ 9 + - /* for the auto-hinter (file `ftautoh.h'), CFF (file `ftcffdrv.h'), and */ 10 + - /* TrueType (file `ftttdrv.h'). */ 11 + + /* for the auto-hinter (file `ftautoh.h'), CFF (file `ftcffdrv.h'), */ 12 + + /* TrueType (file `ftttdrv.h'), and PCF (file `ftpcfdrv.h'). */ 13 + /* */ 14 + /* `FREETYPE_PROPERTIES' has the following syntax form (broken here into */ 15 + /* multiple lines for better readability). */ 16 + @@ -835,6 +835,33 @@ FT_BEGIN_HEADER 17 + /*************************************************************************/ 18 + /*************************************************************************/ 19 + /**** ****/ 20 + + /**** P C F D R I V E R C O N F I G U R A T I O N ****/ 21 + + /**** ****/ 22 + + /*************************************************************************/ 23 + + /*************************************************************************/ 24 + + 25 + + 26 + + /*************************************************************************/ 27 + + /* */ 28 + + /* There are many PCF fonts just called `Fixed' which look completely */ 29 + + /* different, and which have nothing to do with each other. When */ 30 + + /* selecting `Fixed' in KDE or Gnome one gets results that appear rather */ 31 + + /* random, the style changes often if one changes the size and one */ 32 + + /* cannot select some fonts at all. This option makes the PCF module */ 33 + + /* prepend the foundry name (plus a space) to the family name. */ 34 + + /* */ 35 + + /* We also check whether we have `wide' characters; all put together, we */ 36 + + /* get family names like `Sony Fixed' or `Misc Fixed Wide'. */ 37 + + /* */ 38 + + /* If this option is activated, it can be controlled with the */ 39 + + /* `no-long-family-names' property of the pcf driver module. */ 40 + + /* */ 41 + +#define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES 42 + + 43 + + 44 + + /*************************************************************************/ 45 + + /*************************************************************************/ 46 + + /**** ****/ 47 + /**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/ 48 + /**** ****/ 49 + /*************************************************************************/ 50 + diff --git a/docs/CHANGES b/docs/CHANGES 51 + index cb3b327..3823395 100644 52 + --- a/docs/CHANGES 53 + +++ b/docs/CHANGES 54 + @@ -1,4 +1,20 @@ 55 + 56 + +CHANGES BETWEEN 2.7.1 and 2.7.2 57 + + 58 + + I. IMPORTANT CHANGES 59 + + 60 + + - The PCF change to show more `colourful' family names (introduced 61 + + in version 2.7.1) was too radical; it can now be configured with 62 + + PCF_CONFIG_OPTION_LONG_FAMILY_NAMES at compile time. If 63 + + activated, it can be switched off at run time with the new pcf 64 + + property `no-long-family-names'. If the `FREETYPE_PROPERTIES' 65 + + environment variable is available, you can say 66 + + 67 + + FREETYPE_PROPERTIES=pcf:no-long-family-names=1 68 + + 69 + + 70 + +====================================================================== 71 + + 72 + CHANGES BETWEEN 2.7 and 2.7.1 73 + 74 + I. IMPORTANT CHANGES 75 + diff --git a/include/freetype/config/ftheader.h b/include/freetype/config/ftheader.h 76 + index 950d36c..d491af5 100644 77 + --- a/include/freetype/config/ftheader.h 78 + +++ b/include/freetype/config/ftheader.h 79 + @@ -357,6 +357,19 @@ 80 + /************************************************************************* 81 + * 82 + * @macro: 83 + + * FT_PCF_DRIVER_H 84 + + * 85 + + * @description: 86 + + * A macro used in #include statements to name the file containing 87 + + * structures and macros related to the PCF driver module. 88 + + * 89 + + */ 90 + +#define FT_PCF_DRIVER_H <freetype/ftpcfdrv.h> 91 + + 92 + + 93 + + /************************************************************************* 94 + + * 95 + + * @macro: 96 + * FT_TYPE1_TABLES_H 97 + * 98 + * @description: 99 + diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h 100 + index f5bc540..5676074 100644 101 + --- a/include/freetype/config/ftoption.h 102 + +++ b/include/freetype/config/ftoption.h 103 + @@ -82,8 +82,8 @@ FT_BEGIN_HEADER 104 + /* to control the various font drivers and modules. The controllable */ 105 + /* properties are listed in the section `Controlling FreeType Modules' */ 106 + /* in the reference's table of contents; currently there are properties */ 107 + - /* for the auto-hinter (file `ftautoh.h'), CFF (file `ftcffdrv.h'), and */ 108 + - /* TrueType (file `ftttdrv.h'). */ 109 + + /* for the auto-hinter (file `ftautoh.h'), CFF (file `ftcffdrv.h'), */ 110 + + /* TrueType (file `ftttdrv.h'), and PCF (file `ftpcfdrv.h'). */ 111 + /* */ 112 + /* `FREETYPE_PROPERTIES' has the following syntax form (broken here into */ 113 + /* multiple lines for better readability). */ 114 + @@ -835,6 +835,33 @@ FT_BEGIN_HEADER 115 + /*************************************************************************/ 116 + /*************************************************************************/ 117 + /**** ****/ 118 + + /**** P C F D R I V E R C O N F I G U R A T I O N ****/ 119 + + /**** ****/ 120 + + /*************************************************************************/ 121 + + /*************************************************************************/ 122 + + 123 + + 124 + + /*************************************************************************/ 125 + + /* */ 126 + + /* There are many PCF fonts just called `Fixed' which look completely */ 127 + + /* different, and which have nothing to do with each other. When */ 128 + + /* selecting `Fixed' in KDE or Gnome one gets results that appear rather */ 129 + + /* random, the style changes often if one changes the size and one */ 130 + + /* cannot select some fonts at all. This option makes the PCF module */ 131 + + /* prepend the foundry name (plus a space) to the family name. */ 132 + + /* */ 133 + + /* We also check whether we have `wide' characters; all put together, we */ 134 + + /* get family names like `Sony Fixed' or `Misc Fixed Wide'. */ 135 + + /* */ 136 + + /* If this option is activated, it can be controlled with the */ 137 + + /* `no-long-family-names' property of the pcf driver module. */ 138 + + /* */ 139 + +#define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES 140 + + 141 + + 142 + + /*************************************************************************/ 143 + + /*************************************************************************/ 144 + + /**** ****/ 145 + /**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/ 146 + /**** ****/ 147 + /*************************************************************************/ 148 + diff --git a/include/freetype/ftchapters.h b/include/freetype/ftchapters.h 149 + index ab43895..a0a121b 100644 150 + --- a/include/freetype/ftchapters.h 151 + +++ b/include/freetype/ftchapters.h 152 + @@ -77,6 +77,7 @@ 153 + /* auto_hinter */ 154 + /* cff_driver */ 155 + /* tt_driver */ 156 + +/* pcf_driver */ 157 + /* */ 158 + /***************************************************************************/ 159 + 160 + diff --git a/include/freetype/ftpcfdrv.h b/include/freetype/ftpcfdrv.h 161 + new file mode 100644 162 + index 0000000..6622c93 163 + --- /dev/null 164 + +++ b/include/freetype/ftpcfdrv.h 165 + @@ -0,0 +1,105 @@ 166 + +/***************************************************************************/ 167 + +/* */ 168 + +/* ftpcfdrv.h */ 169 + +/* */ 170 + +/* FreeType API for controlling the PCF driver (specification only). */ 171 + +/* */ 172 + +/* Copyright 2017 by */ 173 + +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ 174 + +/* */ 175 + +/* This file is part of the FreeType project, and may only be used, */ 176 + +/* modified, and distributed under the terms of the FreeType project */ 177 + +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 178 + +/* this file you indicate that you have read the license and */ 179 + +/* understand and accept it fully. */ 180 + +/* */ 181 + +/***************************************************************************/ 182 + + 183 + + 184 + +#ifndef FTPCFDRV_H_ 185 + +#define FTPCFDRV_H_ 186 + + 187 + +#include <ft2build.h> 188 + +#include FT_FREETYPE_H 189 + + 190 + +#ifdef FREETYPE_H 191 + +#error "freetype.h of FreeType 1 has been loaded!" 192 + +#error "Please fix the directory search order for header files" 193 + +#error "so that freetype.h of FreeType 2 is found first." 194 + +#endif 195 + + 196 + + 197 + +FT_BEGIN_HEADER 198 + + 199 + + 200 + + /************************************************************************** 201 + + * 202 + + * @section: 203 + + * pcf_driver 204 + + * 205 + + * @title: 206 + + * The PCF driver 207 + + * 208 + + * @abstract: 209 + + * Controlling the PCF driver module. 210 + + * 211 + + * @description: 212 + + * While FreeType's PCF driver doesn't expose API functions by itself, 213 + + * it is possible to control its behaviour with @FT_Property_Set and 214 + + * @FT_Property_Get. Right now, there is a single property 215 + + * `no-long-family-names' available if FreeType is compiled with 216 + + * PCF_CONFIG_OPTION_LONG_FAMILY_NAMES. 217 + + * 218 + + * The PCF driver's module name is `pcf'. 219 + + * 220 + + */ 221 + + 222 + + 223 + + /************************************************************************** 224 + + * 225 + + * @property: 226 + + * no-long-family-names 227 + + * 228 + + * @description: 229 + + * If PCF_CONFIG_OPTION_LONG_FAMILY_NAMES is active while compiling 230 + + * FreeType, the PCF driver constructs long family names. 231 + + * 232 + + * There are many PCF fonts just called `Fixed' which look completely 233 + + * different, and which have nothing to do with each other. When 234 + + * selecting `Fixed' in KDE or Gnome one gets results that appear rather 235 + + * random, the style changes often if one changes the size and one 236 + + * cannot select some fonts at all. The improve this situation, the PCF 237 + + * module prepends the foundry name (plus a space) to the family name. 238 + + * It also checks whether there are `wide' characters; all put together, 239 + + * family names like `Sony Fixed' or `Misc Fixed Wide' are constructed. 240 + + * 241 + + * If `no-long-family-names' is set, this feature gets switched off. 242 + + * 243 + + * { 244 + + * FT_Library library; 245 + + * FT_Bool no_long_family_names = TRUE; 246 + + * 247 + + * 248 + + * FT_Init_FreeType( &library ); 249 + + * 250 + + * FT_Property_Set( library, "pcf", 251 + + * "no-long-family-names", 252 + + * &no_long_family_names ); 253 + + * } 254 + + * 255 + + * @note: 256 + + * This property can be used with @FT_Property_Get also. 257 + + * 258 + + * This property can be set via the `FREETYPE_PROPERTIES' environment 259 + + * variable (using values 1 and 0 for `on' and `off', respectively). 260 + + * 261 + + */ 262 + + 263 + + 264 + +FT_END_HEADER 265 + + 266 + + 267 + +#endif /* FTPCFDRV_H_ */ 268 + + 269 + + 270 + +/* END */ 271 + diff --git a/src/pcf/pcf.h b/src/pcf/pcf.h 272 + index 830cabe..f0390cb 100644 273 + --- a/src/pcf/pcf.h 274 + +++ b/src/pcf/pcf.h 275 + @@ -167,6 +167,8 @@ FT_BEGIN_HEADER 276 + { 277 + FT_DriverRec root; 278 + 279 + + FT_Bool no_long_family_names; 280 + + 281 + } PCF_DriverRec, *PCF_Driver; 282 + 283 + 284 + diff --git a/src/pcf/pcfdrivr.c b/src/pcf/pcfdrivr.c 285 + index 8f4a90d..bc65423 100644 286 + --- a/src/pcf/pcfdrivr.c 287 + +++ b/src/pcf/pcfdrivr.c 288 + @@ -49,6 +49,8 @@ THE SOFTWARE. 289 + 290 + #include FT_SERVICE_BDF_H 291 + #include FT_SERVICE_FONT_FORMAT_H 292 + +#include FT_SERVICE_PROPERTIES_H 293 + +#include FT_PCF_DRIVER_H 294 + 295 + 296 + /*************************************************************************/ 297 + @@ -667,6 +669,110 @@ THE SOFTWARE. 298 + }; 299 + 300 + 301 + + /* 302 + + * PROPERTY SERVICE 303 + + * 304 + + */ 305 + + static FT_Error 306 + + pcf_property_set( FT_Module module, /* PCF_Driver */ 307 + + const char* property_name, 308 + + const void* value, 309 + + FT_Bool value_is_string ) 310 + + { 311 + +#ifdef PCF_CONFIG_OPTION_LONG_FAMILY_NAMES 312 + + 313 + + FT_Error error = FT_Err_Ok; 314 + + PCF_Driver driver = (PCF_Driver)module; 315 + + 316 + +#ifndef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES 317 + + FT_UNUSED( value_is_string ); 318 + +#endif 319 + + 320 + + 321 + + if ( !ft_strcmp( property_name, "no-long-family-names" ) ) 322 + + { 323 + +#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES 324 + + if ( value_is_string ) 325 + + { 326 + + const char* s = (const char*)value; 327 + + long lfn = ft_strtol( s, NULL, 10 ); 328 + + 329 + + 330 + + if ( lfn == 0 ) 331 + + driver->no_long_family_names = 0; 332 + + else if ( lfn == 1 ) 333 + + driver->no_long_family_names = 1; 334 + + else 335 + + return FT_THROW( Invalid_Argument ); 336 + + } 337 + + else 338 + +#endif 339 + + { 340 + + FT_Bool* no_long_family_names = (FT_Bool*)value; 341 + + 342 + + 343 + + driver->no_long_family_names = *no_long_family_names; 344 + + } 345 + + 346 + + return error; 347 + + } 348 + + 349 + +#else /* !PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */ 350 + + 351 + + FT_UNUSED( module ); 352 + + FT_UNUSED( value ); 353 + + FT_UNUSED( value_is_string ); 354 + + 355 + +#endif /* !PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */ 356 + + 357 + + FT_TRACE0(( "pcf_property_set: missing property `%s'\n", 358 + + property_name )); 359 + + return FT_THROW( Missing_Property ); 360 + + } 361 + + 362 + + 363 + + static FT_Error 364 + + pcf_property_get( FT_Module module, /* PCF_Driver */ 365 + + const char* property_name, 366 + + const void* value ) 367 + + { 368 + +#ifdef PCF_CONFIG_OPTION_LONG_FAMILY_NAMES 369 + + 370 + + FT_Error error = FT_Err_Ok; 371 + + PCF_Driver driver = (PCF_Driver)module; 372 + + 373 + + 374 + + if ( !ft_strcmp( property_name, "no-long-family-names" ) ) 375 + + { 376 + + FT_Bool no_long_family_names = driver->no_long_family_names; 377 + + FT_Bool* val = (FT_Bool*)value; 378 + + 379 + + 380 + + *val = no_long_family_names; 381 + + 382 + + return error; 383 + + } 384 + + 385 + +#else /* !PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */ 386 + + 387 + + FT_UNUSED( module ); 388 + + FT_UNUSED( value ); 389 + + 390 + +#endif /* !PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */ 391 + + 392 + + FT_TRACE0(( "pcf_property_get: missing property `%s'\n", 393 + + property_name )); 394 + + return FT_THROW( Missing_Property ); 395 + + } 396 + + 397 + + 398 + + FT_DEFINE_SERVICE_PROPERTIESREC( 399 + + pcf_service_properties, 400 + + 401 + + (FT_Properties_SetFunc)pcf_property_set, /* set_property */ 402 + + (FT_Properties_GetFunc)pcf_property_get ) /* get_property */ 403 + + 404 + + 405 + /* 406 + * 407 + * SERVICE LIST 408 + @@ -677,6 +783,7 @@ THE SOFTWARE. 409 + { 410 + { FT_SERVICE_ID_BDF, &pcf_service_bdf }, 411 + { FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_PCF }, 412 + + { FT_SERVICE_ID_PROPERTIES, &pcf_service_properties }, 413 + { NULL, NULL } 414 + }; 415 + 416 + @@ -694,7 +801,14 @@ THE SOFTWARE. 417 + FT_CALLBACK_DEF( FT_Error ) 418 + pcf_driver_init( FT_Module module ) /* PCF_Driver */ 419 + { 420 + +#ifdef PCF_CONFIG_OPTION_LONG_FAMILY_NAMES 421 + + PCF_Driver driver = (PCF_Driver)module; 422 + + 423 + + 424 + + driver->no_long_family_names = 0; 425 + +#else 426 + FT_UNUSED( module ); 427 + +#endif 428 + 429 + return FT_Err_Ok; 430 + } 431 + diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c 432 + index 38ba110..3eacf2b 100644 433 + --- a/src/pcf/pcfread.c 434 + +++ b/src/pcf/pcfread.c 435 + @@ -1393,57 +1393,75 @@ THE SOFTWARE. 436 + prop = pcf_find_property( face, "FAMILY_NAME" ); 437 + if ( prop && prop->isString ) 438 + { 439 + - /* Prepend the foundry name plus a space to the family name. */ 440 + - /* There are many fonts just called `Fixed' which look completely */ 441 + - /* different, and which have nothing to do with each other. When */ 442 + - /* selecting `Fixed' in KDE or Gnome one gets results that appear */ 443 + - /* rather random, the style changes often if one changes the size */ 444 + - /* and one cannot select some fonts at all. */ 445 + - /* */ 446 + - /* We also check whether we have `wide' characters; all put */ 447 + - /* together, we get family names like `Sony Fixed' or `Misc Fixed */ 448 + - /* Wide'. */ 449 + - PCF_Property foundry_prop, point_size_prop, average_width_prop; 450 + - 451 + - int l = ft_strlen( prop->value.atom ) + 1; 452 + - int wide = 0; 453 + - 454 + - 455 + - foundry_prop = pcf_find_property( face, "FOUNDRY" ); 456 + - point_size_prop = pcf_find_property( face, "POINT_SIZE" ); 457 + - average_width_prop = pcf_find_property( face, "AVERAGE_WIDTH" ); 458 + - 459 + - if ( point_size_prop && average_width_prop ) 460 + + 461 + +#ifdef PCF_CONFIG_OPTION_LONG_FAMILY_NAMES 462 + + 463 + + PCF_Driver driver = (PCF_Driver)FT_FACE_DRIVER( face ); 464 + + 465 + + 466 + + if ( !driver->no_long_family_names ) 467 + { 468 + - if ( average_width_prop->value.l >= point_size_prop->value.l ) 469 + + /* Prepend the foundry name plus a space to the family name. */ 470 + + /* There are many fonts just called `Fixed' which look */ 471 + + /* completely different, and which have nothing to do with each */ 472 + + /* other. When selecting `Fixed' in KDE or Gnome one gets */ 473 + + /* results that appear rather random, the style changes often if */ 474 + + /* one changes the size and one cannot select some fonts at all. */ 475 + + /* */ 476 + + /* We also check whether we have `wide' characters; all put */ 477 + + /* together, we get family names like `Sony Fixed' or `Misc */ 478 + + /* Fixed Wide'. */ 479 + + 480 + + PCF_Property foundry_prop, point_size_prop, average_width_prop; 481 + + 482 + + int l = ft_strlen( prop->value.atom ) + 1; 483 + + int wide = 0; 484 + + 485 + + 486 + + foundry_prop = pcf_find_property( face, "FOUNDRY" ); 487 + + point_size_prop = pcf_find_property( face, "POINT_SIZE" ); 488 + + average_width_prop = pcf_find_property( face, "AVERAGE_WIDTH" ); 489 + + 490 + + if ( point_size_prop && average_width_prop ) 491 + { 492 + - /* This font is at least square shaped or even wider */ 493 + - wide = 1; 494 + - l += ft_strlen( " Wide" ); 495 + + if ( average_width_prop->value.l >= point_size_prop->value.l ) 496 + + { 497 + + /* This font is at least square shaped or even wider */ 498 + + wide = 1; 499 + + l += ft_strlen( " Wide" ); 500 + + } 501 + } 502 + - } 503 + 504 + - if ( foundry_prop && foundry_prop->isString ) 505 + - { 506 + - l += ft_strlen( foundry_prop->value.atom ) + 1; 507 + + if ( foundry_prop && foundry_prop->isString ) 508 + + { 509 + + l += ft_strlen( foundry_prop->value.atom ) + 1; 510 + 511 + - if ( FT_NEW_ARRAY( root->family_name, l ) ) 512 + - goto Exit; 513 + + if ( FT_NEW_ARRAY( root->family_name, l ) ) 514 + + goto Exit; 515 + + 516 + + ft_strcpy( root->family_name, foundry_prop->value.atom ); 517 + + ft_strcat( root->family_name, " " ); 518 + + ft_strcat( root->family_name, prop->value.atom ); 519 + + } 520 + + else 521 + + { 522 + + if ( FT_NEW_ARRAY( root->family_name, l ) ) 523 + + goto Exit; 524 + 525 + - ft_strcpy( root->family_name, foundry_prop->value.atom ); 526 + - ft_strcat( root->family_name, " " ); 527 + - ft_strcat( root->family_name, prop->value.atom ); 528 + + ft_strcpy( root->family_name, prop->value.atom ); 529 + + } 530 + + 531 + + if ( wide ) 532 + + ft_strcat( root->family_name, " Wide" ); 533 + } 534 + else 535 + + 536 + +#endif /* PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */ 537 + + 538 + { 539 + - if ( FT_NEW_ARRAY( root->family_name, l ) ) 540 + + if ( FT_STRDUP( root->family_name, prop->value.atom ) ) 541 + goto Exit; 542 + - 543 + - ft_strcpy( root->family_name, prop->value.atom ); 544 + } 545 + - 546 + - if ( wide ) 547 + - ft_strcat( root->family_name, " Wide" ); 548 + } 549 + else 550 + root->family_name = NULL; 551 + -- 552 + cgit v1.0-41-gc330 553 +
+68
pkgs/development/libraries/freetype/pcf-introduce-driver.patch
··· 1 + diff --git a/src/pcf/pcf.h b/src/pcf/pcf.h 2 + index c726e5e..830cabe 100644 3 + --- a/src/pcf/pcf.h 4 + +++ b/src/pcf/pcf.h 5 + @@ -163,6 +163,13 @@ FT_BEGIN_HEADER 6 + } PCF_FaceRec, *PCF_Face; 7 + 8 + 9 + + typedef struct PCF_DriverRec_ 10 + + { 11 + + FT_DriverRec root; 12 + + 13 + + } PCF_DriverRec, *PCF_Driver; 14 + + 15 + + 16 + /* macros for pcf font format */ 17 + 18 + #define LSBFirst 0 19 + diff --git a/src/pcf/pcfdrivr.c b/src/pcf/pcfdrivr.c 20 + index 10d5c20..8f4a90d 100644 21 + --- a/src/pcf/pcfdrivr.c 22 + +++ b/src/pcf/pcfdrivr.c 23 + @@ -691,22 +691,38 @@ THE SOFTWARE. 24 + } 25 + 26 + 27 + + FT_CALLBACK_DEF( FT_Error ) 28 + + pcf_driver_init( FT_Module module ) /* PCF_Driver */ 29 + + { 30 + + FT_UNUSED( module ); 31 + + 32 + + return FT_Err_Ok; 33 + + } 34 + + 35 + + 36 + + FT_CALLBACK_DEF( void ) 37 + + pcf_driver_done( FT_Module module ) /* PCF_Driver */ 38 + + { 39 + + FT_UNUSED( module ); 40 + + } 41 + + 42 + + 43 + FT_CALLBACK_TABLE_DEF 44 + const FT_Driver_ClassRec pcf_driver_class = 45 + { 46 + { 47 + FT_MODULE_FONT_DRIVER | 48 + FT_MODULE_DRIVER_NO_OUTLINES, 49 + - sizeof ( FT_DriverRec ), 50 + 51 + + sizeof ( PCF_DriverRec ), 52 + "pcf", 53 + 0x10000L, 54 + 0x20000L, 55 + 56 + - NULL, /* module-specific interface */ 57 + + NULL, /* module-specific interface */ 58 + 59 + - NULL, /* FT_Module_Constructor module_init */ 60 + - NULL, /* FT_Module_Destructor module_done */ 61 + + pcf_driver_init, /* FT_Module_Constructor module_init */ 62 + + pcf_driver_done, /* FT_Module_Destructor module_done */ 63 + pcf_driver_requester /* FT_Module_Requester get_interface */ 64 + }, 65 + 66 + -- 67 + cgit v1.0-41-gc330 68 +
+52
pkgs/development/libraries/pcre/CVE-2017-7186.patch
··· 1 + --- a/pcre_internal.h 2016/05/21 13:34:44 1649 2 + +++ b/pcre_internal.h 2017/02/24 17:30:30 1688 3 + @@ -2772,6 +2772,9 @@ 4 + extern const pcre_uint16 PRIV(ucd_stage2)[]; 5 + extern const pcre_uint32 PRIV(ucp_gentype)[]; 6 + extern const pcre_uint32 PRIV(ucp_gbtable)[]; 7 + +#ifdef COMPILE_PCRE32 8 + +extern const ucd_record PRIV(dummy_ucd_record)[]; 9 + +#endif 10 + #ifdef SUPPORT_JIT 11 + extern const int PRIV(ucp_typerange)[]; 12 + #endif 13 + @@ -2780,9 +2783,15 @@ 14 + /* UCD access macros */ 15 + 16 + #define UCD_BLOCK_SIZE 128 17 + -#define GET_UCD(ch) (PRIV(ucd_records) + \ 18 + +#define REAL_GET_UCD(ch) (PRIV(ucd_records) + \ 19 + PRIV(ucd_stage2)[PRIV(ucd_stage1)[(int)(ch) / UCD_BLOCK_SIZE] * \ 20 + UCD_BLOCK_SIZE + (int)(ch) % UCD_BLOCK_SIZE]) 21 + + 22 + +#ifdef COMPILE_PCRE32 23 + +#define GET_UCD(ch) ((ch > 0x10ffff)? PRIV(dummy_ucd_record) : REAL_GET_UCD(ch)) 24 + +#else 25 + +#define GET_UCD(ch) REAL_GET_UCD(ch) 26 + +#endif 27 + 28 + #define UCD_CHARTYPE(ch) GET_UCD(ch)->chartype 29 + #define UCD_SCRIPT(ch) GET_UCD(ch)->script 30 + --- a/pcre_ucd.c 2014/06/19 07:51:39 1490 31 + +++ b/pcre_ucd.c 2017/02/24 17:30:30 1688 32 + @@ -38,6 +38,20 @@ 33 + const pcre_uint32 PRIV(ucd_caseless_sets)[] = {0}; 34 + #else 35 + 36 + +/* If the 32-bit library is run in non-32-bit mode, character values 37 + +greater than 0x10ffff may be encountered. For these we set up a 38 + +special record. */ 39 + + 40 + +#ifdef COMPILE_PCRE32 41 + +const ucd_record PRIV(dummy_ucd_record)[] = {{ 42 + + ucp_Common, /* script */ 43 + + ucp_Cn, /* type unassigned */ 44 + + ucp_gbOther, /* grapheme break property */ 45 + + 0, /* case set */ 46 + + 0, /* other case */ 47 + + }}; 48 + +#endif 49 + + 50 + /* When recompiling tables with a new Unicode version, please check the 51 + types in this structure definition from pcre_internal.h (the actual 52 + field names will be different):
+4 -2
pkgs/development/libraries/pcre/default.nix
··· 7 7 assert elem variant [ null "cpp" "pcre16" "pcre32" ]; 8 8 9 9 let 10 - version = "8.39"; 10 + version = "8.40"; 11 11 pname = if (variant == null) then "pcre" 12 12 else if (variant == "cpp") then "pcre-cpp" 13 13 else variant; ··· 17 17 18 18 src = fetchurl { 19 19 url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-${version}.tar.bz2"; 20 - sha256 = "12wyajlqx2v7dsh39ra9v9m5hibjkrl129q90bp32c28haghjn5q"; 20 + sha256 = "1x7lpjn7jhk0n3sdvggxrlrhab8kkfjwl7qix0ypw9nlx8lpmqh0"; 21 21 }; 22 22 23 23 outputs = [ "bin" "dev" "out" "doc" "man" ]; ··· 28 28 "--disable-cpp" 29 29 ] 30 30 ++ optional (variant != null) "--enable-${variant}"; 31 + 32 + patches = [ ./CVE-2017-7186.patch ]; 31 33 32 34 doCheck = with stdenv; !(isCygwin || isFreeBSD); 33 35 # XXX: test failure on Cygwin
+5
pkgs/misc/cups/default.nix
··· 79 79 # Delete obsolete stuff that conflicts with cups-filters. 80 80 rm -rf $out/share/cups/banners $out/share/cups/data/testprint 81 81 82 + # Some outputs in cups-config were unexpanded and some even wrong. 82 83 moveToOutput bin/cups-config "$dev" 84 + sed -e "/^cups_serverbin=/s|\$(lib)|$out|" \ 85 + -e "s|\$(out)|$out|" \ 86 + -e "s|\$(lib)|$lib|" \ 87 + -i "$dev/bin/cups-config" 83 88 84 89 # Rename systemd files provided by CUPS 85 90 for f in "$out"/lib/systemd/system/*; do
+2 -2
pkgs/os-specific/linux/systemd/default.nix
··· 15 15 src = fetchFromGitHub { 16 16 owner = "nixos"; 17 17 repo = "systemd"; 18 - rev = "c110fc3504d7a2fa944575b347814f7e97d3c5a0"; 19 - sha256 = "19carch1adad70nifbqdx649kj5m8pgpiq27hh05ig38yrbmb2vz"; 18 + rev = "66e778e851440fde7f20cff0c24d23538144be8d"; 19 + sha256 = "1valz8v2q4cj0ipz2b6mh5p0rjxpy3m88gg9xa2rcc4gcmscndzk"; 20 20 }; 21 21 22 22 outputs = [ "out" "lib" "man" "dev" ];